![]() ![]() Simple tools can help navigate through the output from strace to locate problem areas. The strace utility provides invaluable information in diagnosing and debugging performance issues. To solve the slow loading issue, the web site PHP code has to be modified to avoid such blocking connections that can significantly slow down site performance. So we have a tcp connection to port 443 on the masked IP address, which just times out after 30 seconds, slowing down the page load. The output from the script shows us where we might want to investigate further: Our timefilter script identifies lines that are spaced apart by more than its argument (20 seconds in this case). There are many possible ways to do this, we chose to write a simple perl script to locate such lines in the sorted trace file: With the data sorted, we are now looking for traces that show long delays in process execution. We may get false positives when examining the sorted output if the time trace wraps around, and we’ll have to account for these cases). (Note this is just a simple tool that does not account for times wrapping around midnight – strace output does not provide date information. To make this information easier to narrow down, we can apply some tools – first we can remove non pid trace lines and sort the output by process id and then timestamp. We need to look for the symptom that is impacting performance, in our case a long delay between subsequent trace lines for the same process. The strace output is typically massive and includes large amounts of data that is not directly relevant to the problem we are trying to diagnose. Stop the strace process (hit Ctrl-C or your interrupt key) when done. The arguments to strace include printing microsecond data (-tt) and showing the time spent in system calls (-T). Now we can strace the process, redirect output to a file, and reproduce the problem (in this case reloading the homepage for the site) while strace is running: There should be one parent lsphp process and several children processes. Since the platform uses LiteSpeed, we’ll be looking for running lsphp processes. We’ll need the process id of the relevant PHP process. Using strace allows us to examine the behavior of PHP when handling requests. The strace command provides fine-grained information on an executing process. Most steps in How to improve my site’s performance were tried but none worked. Output from top command showed no significant traffic, server load was well below 1. Increasing CloudLinux LVEs for the account did not help. Moving account user into the cage and changing PHP to 7.0 using php selector did not help – loading just as slow as PHP 5.6, with no PHP out of memory errors or core files generated. Increasing PHP_SuEXEC_max_connection for the domain did not help. No mod_bw limitation found in the configuration. LiteSpeed with cPanel EA3 on CloudLinux, Drupal website.ĭrupal site running PHP 5.6 without a full page cache solution.ĬloudLinux PHP selector installed but not enabled. Server logs log/stderr and log/system do not indicate unusual behavior. Home page is exhibiting slow load times (40 to 50 seconds). ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |