PHP Slow Log and FPM Error Log
Improve site stability using PHP Slow Log and PHP FPM Error Log to identify serious performance issues.
This section provides information on how to use the PHP Slow Log and the PHP FPM Error Log to improve your site's performance.
A key way to find issues on your website is to check your PHP logs. You can use your PHP Slow Log and PHP FPM Error Log to find performance issues and PHP errors on Pantheon sites.
Before You Begin
Make sure that you have:
- An SFTP command line interface (CLI)
- A working knowledge of PHP
Download the PHP Slow Log and PHP FPM Error Log via SFTP
- Add yourself to the site's team membership.
- Get the SFTP connection information for the environment (Test, Dev, Live, or a Multidev) from the site's Dashboard.
- Open a command line prompt and paste the SFTP connection information.
- Navigate to the Logs directory, and use a
getcommand to download the PHP slow log to your local machine for analysis.
Note: If there is no php/ directory in logs/, the files will be located directly within logs.
Analyze the PHP Slow Log
- Search for custom modules or theme files (
template.phpfile,*.tpl.phpfiles, etc.). This trace has both a custom Feature module (/sites/all/modules/features/tdm_community.module, field_get_items()function) and a.tplfile (/sites/all/themes/themename/templates/page.tpl.php, render() function).
The script filenames might have a different path such as /srv/bindings/d142301948514750b2ff39988as6f4b9158e5/code/index.php.
- Search for contributed modules or plug-ins that may be detrimental to the site.
stream_wrappers.incis showing twice at the exact same timestamp (08-Dec-2014 16:56:48) and is used to bring in external streaming media. This is often the cause of significant performance issues on sites.
- Use a
grepcommand to get a count of how many times a given file is called in a PHP slow log. Examples:
By using these methods and files to find your PHP errors and performance issues, you will be able to greatly improve the stability of your website.