If you’ve noticed performance issues or intermittent “stuttering” on your server, adjusting a few PHP-FPM settings might help. Below is a quick recap of our tweaks and how they helped resolve error messages and potential timeouts.
1. Identify the Problem
We observed frequent occurrences of the following error in our logs:
This indicated a possible internal error or timeout issue with PHP-FPM.
2. Adjust PHP-FPM Configuration
We modified the `pool.d` configuration file (/etc/phpX.X/fpm/pool.d/...) values related to timeouts, logging, and compression. Specifically:
- **request_terminate_timeout**: Ensures long-running scripts don’t hang indefinitely.
- **max_execution_time**: Increases the maximum time a script can run before timing out.
- **zlib.output_compression**: Disabled to reduce overhead and avoid compression-related issues.
- **error_reporting**: Turned off to reduce extraneous log entries.
3. Check for Performance Improvements
After making these changes, restart PHP-FPM:and the error mentioned above should stop appearing in the error log. This suggests that increasing the maximum execution time and disabling zlib output compression can address issues with specific requests taking too long or running into compression conflicts.
4. Monitor for Additional Issues
If you perform similar changes, keep an eye on both performance metrics and error logs. Sometimes, large or complex scripts may still require further optimization or different configuration tweaks.
5. Conclusion
Fine-tuning PHP-FPM settings often helps stabilize and optimize your application, especially if you’re seeing errors or experiencing slowdowns. Adjusting parameters like `max_execution_time` and turning off zlib compression in certain cases can resolve “Internal error” messages and improve overall performance.
1. Identify the Problem
We observed frequent occurrences of the following error in our logs:
Code:
(20014)Internal error (specific information not available): [client 95.217.144.173:33902] AH01075: Error dispatching request to : (passing brigade to output filters)
2. Adjust PHP-FPM Configuration
We modified the `pool.d` configuration file (/etc/phpX.X/fpm/pool.d/...) values related to timeouts, logging, and compression. Specifically:
Code:
request_terminate_timeout = 900sphp_admin_value[max_execution_time] = 300php_admin_value[zlib.output_compression] = offphp_admin_value[zlib.output_compression_level] = -1php_admin_value[zlib.output_handler] =php_admin_value[error_reporting] = off
- **max_execution_time**: Increases the maximum time a script can run before timing out.
- **zlib.output_compression**: Disabled to reduce overhead and avoid compression-related issues.
- **error_reporting**: Turned off to reduce extraneous log entries.
3. Check for Performance Improvements
After making these changes, restart PHP-FPM:
Code:
systemctl restart phpX.X-fpm
4. Monitor for Additional Issues
If you perform similar changes, keep an eye on both performance metrics and error logs. Sometimes, large or complex scripts may still require further optimization or different configuration tweaks.
5. Conclusion
Fine-tuning PHP-FPM settings often helps stabilize and optimize your application, especially if you’re seeing errors or experiencing slowdowns. Adjusting parameters like `max_execution_time` and turning off zlib compression in certain cases can resolve “Internal error” messages and improve overall performance.
Statistics: Posted by isscbta — Mon Mar 17, 2025 11:36 am