A PHP timeout occurs when a Drupal or PHP request takes longer than five minutes to produce output, terminates, and produces an HTTP 500 error. Most web browsers, depending on the client, don’t wait longer than two minutes before discontinuing a request and displaying an error.
Long-running processes consume infrastructure resources. If there are too many processes running, it impairs the performance of your application. The Acquia Cloud web stack accommodates requests that require extra time to complete, but does not to allow a process to run indefinitely.
The following are potential causes of PHP timeouts:
A cron.php request that runs too long
Complex database queries on large quantities of data; for example, multiple JOINs on large database tables
Extended database table locks; for example, explicit table locks or structural changes on large tables
Drupal Views that produce complex database queries on large databases
Calls to slow or unresponsive external service providers using RPC calls, the cURL library, file_get_contents($url), or similar methods
Processing extremely large database result sets in PHP code
File operations that involve extremely large files or directories
PHP bugs; for example, infinite loops or infinite recursions
Calls to the sleep() function for extended lengths of time; for example, as an exponential back-off throttle
Some potential solutions for PHP timeout issues include:
Examine your application’s Apache logs, which include a request_time field that indicates how many microseconds it takes to deliver each page of your application. Examine the Drupal request logs and look for requests with a long php_time or queue_wait value. You can stream the Drupal request log in real time or download the Drupal request log from the Cloud Platform interface Logs page. See About Cloud Platform logging and Streaming log entries in real time.
To view page delivery performance details, use the Drupal Performance logging features in the Devel module. Only use Devel for applications in non-production environments.
To diagnose slow performance, run performance checks and report failures or warnings. Inspection of server resource usage, database query efficiency, and cache configurations is vital to improve page load times.
To collect detailed logs that can aid in identifying performance bottlenecks, use the module.
Troubleshooting PHP timeouts
A PHP timeout occurs when a Drupal or PHP request takes longer than five minutes to produce output, terminates, and produces an HTTP 500 error. Most web browsers, depending on the client, don’t wait longer than two minutes before discontinuing a request and displaying an error.
Long-running processes consume infrastructure resources. If there are too many processes running, it impairs the performance of your application. The Acquia Cloud web stack accommodates requests that require extra time to complete, but does not to allow a process to run indefinitely.
The following are potential causes of PHP timeouts:
A cron.php request that runs too long
Complex database queries on large quantities of data; for example, multiple JOINs on large database tables
Extended database table locks; for example, explicit table locks or structural changes on large tables
Drupal Views that produce complex database queries on large databases
Calls to slow or unresponsive external service providers using RPC calls, the cURL library, file_get_contents($url), or similar methods
Processing extremely large database result sets in PHP code
File operations that involve extremely large files or directories
PHP bugs; for example, infinite loops or infinite recursions
Calls to the sleep() function for extended lengths of time; for example, as an exponential back-off throttle
Some potential solutions for PHP timeout issues include:
Examine your application’s Apache logs, which include a request_time field that indicates how many microseconds it takes to deliver each page of your application. Examine the Drupal request logs and look for requests with a long php_time or queue_wait value. You can stream the Drupal request log in real time or download the Drupal request log from the Cloud Platform interface Logs page. See About Cloud Platform logging and Streaming log entries in real time.
To view page delivery performance details, use the Drupal Performance logging features in the Devel module. Only use Devel for applications in non-production environments.
To diagnose slow performance, run performance checks and report failures or warnings. Inspection of server resource usage, database query efficiency, and cache configurations is vital to improve page load times.
To collect detailed logs that can aid in identifying performance bottlenecks, use the Syslog module.