Sep 28, 2011

Test PHP script load on Debian server


Anyone maybe know is there Linux (debian) tool for testing PHP application performance? I want to check in witch places my PHP/MySQL script need optimization.


If you want to profile your scripts and tweak performance under test conditions, have a look at xdebug.

For HTTP optimization, you could do a lot worse than firebug.

However that does not replace the need to tune the application as a whole – if you’ve got a script taking 30 seconds to complete which only gets run once a month – then its less of a priority then one which takes 5 seconds and is fired of 1000 times per hour.

AFAIK there’s no free off-the-shelf solution – I added %D to my apache logs and use some custom code around that to identify problems areas (prioritized based on product of frequency and duration for each URL). I also use a modified version of this mysql log parser for my SQL code.

I’m currently in the process of evaluating Yahoo Boomerang and graphite for capturing large volumes of performance data.

There are commercial offerings – but

  • PHP support is limited
  • they are usually very expensive.

Related posts:

  1. Server speed: sharing one script.php or using many copies the same script.php
  2. PHP Script Won’t Run – Apache2/MySQL Servers Running, PHP Installed – Ubuntu 10.04
  3. Is there any server performance monitor php script?
  4. Nginx + php-fpm “504 Gateway Time-out” error with almost zero load (on a test-server)
  5. running a bash script as root to change the date, when called by a php script

Leave a comment