Search code examples
phpmemcachedprofileexecution

PHP execution time: Factor to consider in determining the speed to execution


As all my requests goes through an index script, I tried to time the respond time of all my requests.

Its simply the difference between the start time (start of the script) and end time (end of the script).

As I cache my data on memcached and user are all served using memcached.

I mostly get less than a second respond time but at times there's wierd spike of more than a seconds. the worse case can go up to 200+ seconds.

I was wondering if mobile users had a slow connection, does that reflect on my respond time?

I am serving primary mobile users.

Thanks!


Solution

  • If you're measuring in PHP (which it sounds like you are), thats the time it takes for the page to be generated on the server side, not the time it takes to be downloaded.

    Drop timers in throughout the page, and try and break it down to a section that is causing the huge delay of 200+ seconds.

    You could even add a small script that will email you details of how long each section took to load if it doesn't happen often enough to see it yourself.