Troubleshooting slow page load time

nrep

Well-known member
I've just bought a new server with 32GB ram, Dual 2650 Xeons, Windows 2012 and 400GB SSD RAID for storage. I copied over a small XF site when testing the server, but the page load speed isn't as fast as I thought:

Timing:
0.3120 seconds
Memory:
4.049 MB
DB Queries:
11

Disabling all addons results in a very small reduction in load time, but only around 10%.

I looked at a thread about load times (https://theadminzone.com/threads/your-xenforo-board-forum_list-index-loading-stats.116198/) and this seems to be above many of these, even on a powerful and empty server. IIS 8.5 isn't that bad! Google Page Insights even says "Reduce server response time" when I run a test.

Is there a way that I can break down that load time further? When I view the ?_debug=1 link it shows that the MySQL queries are running in milliseconds - so it seems to be PHP that is slow. I've tried PHP 5.4 and PHP 5.5, with and without WinCache and Zend OpCache enabled. The load times barely move. We're using MySQL 5.6.

Where else can I look? I'm sure there must be something I've overlooked to cause this.
 
Last edited:
The page generation times seem to be around 0.3-0.8 seconds, and since the post above I've tried disabling the AV/Firewall, tested the time taken for the mysqli connection (fine), many versions of PHP, checking my.ini and php.ini, all with no luck.

My local test server on Windows 7 can generate the same page in less than 0.1s, and this PC is nowhere near as powerful.

Interestingly, a VB 3.8 site will render a page in around 0.05s on the server - so it seems to be related to XF (no addons).
 
Make sure you have an opcode cache installed. But then, as a test, try setting it such that "stat" checks aren't made. In OpCache, that would be disabling opcache.validate_timestamps. Does that make a difference? (Confirm that it's working by making a script that outputs something, loading it, changing the script and loading it again; the output shouldn't change.)

It might also be worth checking Apache next to IIS (different port) to see if that shows a significant difference.
 
Make sure you have an opcode cache installed. But then, as a test, try setting it such that "stat" checks aren't made. In OpCache, that would be disabling opcache.validate_timestamps. Does that make a difference? (Confirm that it's working by making a script that outputs something, loading it, changing the script and loading it again; the output shouldn't change.)

It might also be worth checking Apache next to IIS (different port) to see if that shows a significant difference.

Thanks Mike, I've got Zend OpCache installed and did have opcache.validate_timestamps enabled, however I had opcache.revalidate_freq set to 60 seconds. I tried disabling it entirely to no avail - tested by adding debug string to config.php and it didn't take effect until I restarted IIS.

Is there a way I can expand the debug output to see where the delay is, as it doesn't seem to be with the MySQL queries?
 
You would need to run a full profiler on it (which would slow it down itself, but hopefully "linearly"). The general debug output could never really be detailed enough to identify a slight slowdown like this.
 
I've got Xdebug running now to see if I can get a more in depth look at where the slowness is coming from. Will report back if I find anything :).
 
I've noticed some addons can easily do this if they don't have event hints and then touch load_class or load_class_model events.
 
Top Bottom