My production server is Windows Server 2012 R2, Apache 2.4, PHP 5.6, and MariaDB (unsure of version, probably irrelevant). I have a customized site running on Silverstripe 3.5.
Lately, I'm getting ridiculous TTFBs with certain actions, most notably logging in (over 30 seconds), or sometimes at random while browsing the backend. Curiously, this does not happen on our development server which is configured similarly, and our IT department is going to pour over
php.ini to see if there are any differences which could be an issue.
I enabled the Zend OpCache extension in hopes that it would help, but I'm not seeing any significant improvements.
I installed XDebug and triggered profiling while logging in (by adding a hidden form field named XDEBUG_PROFILE via the DOM inspector), but the output when viewed in WinCachegrind says that PHP's execution took no more than 5 seconds cumulatively - i.e. the total cumulative time in
main.php was 4.x seconds. There doesn't seem to be a notable bottleneck in the framework logic or database access.
httpd.exe takes up a solid 14% of my CPU for the duration of the request. Watching the logs with Powershell's
gci -Wait shows that the request isn't logged in
access.log until after the response is sent (not sure if normal behavior) and there are no errors popping up.
I'm stumped as to why Apache is taking so long to process a request that PHP claims to only take 4 seconds to perform logic on. While potential solutions may be appreciated, I'd really like to know where else I can look in terms of diagnostics to figure out what's causing Apache to slow down like this, e.g. file access, tracing execution, etc? I haven't the foggiest as to where to even begin looking.