1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Troubleshooting slow page load time

Discussion in 'Server Configuration and Hosting' started by nrep, Nov 6, 2014.

  1. nrep

    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:

    0.3120 seconds
    4.049 MB
    DB Queries:

    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: Nov 6, 2014
  2. nrep

    nrep Well-Known Member

    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).
  3. Mike

    Mike XenForo Developer Staff Member

    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.
  4. nrep

    nrep Well-Known Member

    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?
  5. Mike

    Mike XenForo Developer Staff Member

    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.
  6. nrep

    nrep Well-Known Member

    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 :).
  7. Xon

    Xon Well-Known Member

    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.

Share This Page