Hi all,
I'm having an issue where when PHP, IIS and MySQL are all used, I have really bad delay times, especially with First Time to Byte. I know there are a lot of threads on this but none have managed to solve my problem.
Here is my current configuration:
Server 1: IIS 7.5 / Win2k8 R2, PHP v5.3.5 with the following options
- WinCache v1.1 installed and enabled.
- Session.handlers set to wincache as well.
- maxInstances set to 0
The whole lot was installed by WebPI and is managed via WebSitePanel.
Server 2: MySQL is a separate box running v5.1.54 and has had a few config changes. The MySQL Box also has MSSQL 2008R2 Web Edition installed.
Here are the tests I've been able to perform. Most of my testing has been via Pingdom. Note that my testing is based on US servers to our colo in Australia, so we expect the connect time to be at least 350-500ms.
Our results only look at the initial request. We are ignoring any additional data load times.
Test site 1: PHP static site, PHP headers and footers, HTML content no MySQL:
LAMP: Connect 500ms, First Byte 1200ms, Last Btye 1300ms.
WIMP: Connect 500ms First Byte 1250ms, Last Byte 1400ms.
Test site 2: PHP Info
Connect: 350ms, FB 2050ms, LB 2100ms
Test site 3: PHP Dynamic site, wordpress v3.03 very little content, MySQL:
Connect: 700ms, FB 6050ms, LB 6100ms.
Test site 4: ASP.NET site, Sitefinity, MSSQL:
Connect: 350ms, FB 1900ms, LB 2000ms.
As you can see from the results, we are noticing a 4-6 second delay when using IIS / PHP / MySQL. Under these circumstances, we are noticing this on every click response. Some Wordpress sites are running faster than others (so some at 4sec, others at 6 but this is the median range so we don't believe its JS holding things up but may explain the 2 sec difference between various sites).
So on to some of the things we have noticed: From these results, we immediately start looking at processing delay between PHP and MySQL. On the wordpress site, we activated a MySQL plugin to look at the time it took to process the request. From what we noticed, the processing delay was 91ms in total - nothing that would explain a jump from 2seconds to 4+ seconds for a response.
We also enabled failed request tracing and could see the 4-6second delay, but all it told us was it was somewhere in the fastcgi component; nothing to assist us with troubleshooting the issue.
We found a forum thread which mentioned turning off name resolution (skip-name-resolve) in the my.ini file which we have done - we believe this did improve things slightly but only by about 20ms or so.
As mentioned above, we have set instance autotuning to on and setup the Wincache extensions. We also looked at a cache plugin for Wordpress but that didn't seem to help either.
I know that the issue is when MySQL is engaged so perhaps the problem still lies there but our MySQL tracing suggests that this is not the cause either. We enabled slow queries log and nothing is showing up there either...
I'm happy to provide more information on request, but this problem is killing me - customers are starting to notice these lag times as the pages don't render for at least 4 seconds after each click and we may be forced to go with LAMP if we cannot drill down to the cause of the problem.
Our LAMP systems seem to be very responsive compared to WIMP. The page render times on WIMP are great, but only after we get the the first byte response. Its that lag that is causing us major grief.
If anyone could suggest anything we could do to futher troubleshoot the problem so we can understand what delays are being incurred end-to-end, in particular, PHP, then that would be great. I will be posting this on the PHP forums as well, but I strongly believe that the problem is PHP / IIS related at this stage.
All our servers are running W2K8R2 with firewall services turned off. All devices are connected on the same Cisco switch.
HELP!