0

At work we have a Windows Server 2008 R2 setup as webserver. We have IIS installed and with the Web Platform Installer we have installed PHP.

The problem now is, the performance of the server is quite poor. The app runs totally fine on a lot of different machines (I've tried on Windows 7, OSX, Linux Ubuntu and even another 2008 R2 server). The page is loading, but it takes about 2-3 seconds, where all the other machines are ready in about 200-400 milliseconds. I've tried to debug what is happening and it looks like the server is just 'waiting' for 2 seconds on every request. I looked at the timelines from Firebug and Chrome, and they show me that they're sending the request in a few milliseconds, then they're waiting for 2 seconds, before the server will send back a response.

What could cause these 2 seconds? Normally I would say "a slow running app" but given the fact that I tried it out on a lot of other machines, and the app is running fine, I don't think that's the problem.

So I hope someone can help me, or at least give me a push in the right direction.

EDIT: I have been able to shave about half of the 'delay' time off, by setting all the database hosts to 127.0.0.1 instead of localhost. Don't know why, but it does seem to speed things up. Got to love Microsoft Servers....

EDIT2: I have uploaded my ini file over here, please have a look if you can find anything https://gist.github.com/Crinsane/6577840

Thanks in advance!

3
  • You may want to post your PHP configuration. There are a lot of Windows specific tuning stuff in there. Just reading it will likely help you. Sep 11, 2013 at 14:04
  • @TheFiddlerWins php.ini file you mean?
    – Crinsane
    Sep 11, 2013 at 14:08
  • The 127.0.0.1 is probably because of IPv6. See stackoverflow.com/questions/11663860/… Perhaps you may not to disable IPv6 and see if it helps.
    – MikeLim
    Sep 15, 2013 at 7:35

2 Answers 2

0
+100

IsFastCGI enabled in IIS? Also install and enable Wincache. It helps.

Could be a PHP.INI configuration problem. Since you mention that it works well on other machines,use the PHP.INI file from the other machine.

11
  • FastCGI is indeed enabled. I've also installed Wincache, but didn't really see any difference. Should the difference be really noticable? Maybe I installed it wrong...
    – Crinsane
    Sep 15, 2013 at 6:31
  • Add a virtual dir to c:\program files(x86)\iis\Windows Cache for PHP\ (?) to view wincache.php. Check Opcache section to verify functionality.
    – MikeLim
    Sep 15, 2013 at 7:12
  • I cheched Wincache, and from what I see it is working.
    – Crinsane
    Sep 15, 2013 at 11:34
  • If you disable wincache, response time will usually be longer. Guess the delay could be database (MySQL?) connectivity, cos you mention 127.0.0.1 instead of localhost for host. Try disable IPv6. Also disable ant-virus. Next is PHP tuning. Comment out open_basedir (if in use) in your PHP.INI. Possible to reproduce your PHP.INI settings?
    – MikeLim
    Sep 15, 2013 at 11:58
  • What do you mean with that last? Reproduce my php.ini settings?
    – Crinsane
    Sep 15, 2013 at 12:26
0

Is your configuration with http://php.net/manual/en/function.sleep.php . or any of the variants? You could search in all files if it is used . That should delay the access with 2 seconds and as far as I know it's taken differently by OS versions . Or test again by trying to deploy the same site version on all server then see if it has the same delay . This could also be a delay from the Database server (if you are using different database sources ) and you could test that also .

Please see this after because you using php in a mixed enviroment (with IIS as you explained) http://www.iis.net/learn/application-frameworks/install-and-configure-php-on-iis/how-to-configure-and-optimize-the-microsoft-web-platform-for-php .

2
  • Thanks for the information, I know the sleep() function is not used, so that won't be the cause. But I'm going to read the other stuff, and see if that fixes it.
    – Crinsane
    Sep 13, 2013 at 17:36
  • To add to that, I've already tried out the exact same site version on different machines, and none have the same delay.
    – Crinsane
    Sep 14, 2013 at 6:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .