Jump to content

Randomly long execution time of index.php


Recommended Posts


i have encountered a random problem with my processwire page. I have build a simple php file where i include the processwire index.php and run 1 simple database query and echo the total execution time of the script. I call this file periodically to check the performance of the page. Most of the time the execution time is under 0.5 seconds, but some times i goes up to over 3 or 4 seconds. The database query takes very little time, so the problem seems to be in the code called in index.php. 

I checked my server and database metrics and they look perfectly fine. Has anybody experienced similar issues before? Or do you guys have any tips how to debug that issue the best?


Thanks for your help in advance



Link to comment
Share on other sites

Sorry, but I cannot resist:


... so the problem seems to be in the code called in index.php

For me this sounds funny, as the index.php is wrapped around everything what has to do with / runs within PW, including 1k+ core files, all your site files, incl. templates, third-party modules and optionally other included scripts.

Measuring the index.php execution time seems to be not the most useful concept for anything more than determining the total execution time.

Also, if you have encountered times from 0.5 to 3-4 seconds for the same requests, it looks to me more to be server side issues than not performant coded templates or third party modules. If you would have encountered a request with a specific template to be always 3-4 seconds whereas others run under 0.5, this would be an indice for code bottle neck or that like.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...