Partner and Community Forums
Windows Cache Extension for PHP
Hanging problem and "Service unavailable"
Last post Feb 12, 2010 03:34 PM by don.raman
Dec 04, 2009 03:23 PM|LINK
Hi, I was very pleased to see a "production ready" cache extension for PHP 5.3 on Windows which I happily tested on my dev server without problem. However, on our production server (an intranet with medium load), it randomly "hang". All PHP processes stop
responding, sometimes one of them will be stuck on something using 50% of the cpu and at the base of the thread stack (with Process Explorer) is the php_wincache.dll. I have to manually kill all of them or the whole IIS stop responding. The browser try to
load for a while and I get a "Service unavailable", even on static content. I kill them all, restart the service and it will work fine for an hour or 2 before it hang again. It does not coincides with app pool recycling as it happens even when it is turned
My configuration is the following:
Dec 04, 2009 04:22 PM|LINK
Can you follow the post at http://forums.iis.net/t/1163114.aspx and see if this solves your problem. Ideally just reinstall WINCACHE from the location mentioned in the post and see if you are still getting
the crash. If yes, please report it back. If this fixes your problem, it will be good to hear that too.
Dec 04, 2009 05:54 PM|LINK
I am compiling wincache myself and I don't see any difference in the source from the
PECL site and the one I am using. Was the source also updated? I cannot use the pre builded binaries since I am compiling PHP with VC8, which I need to do to compile a PHP extension I made for our intranet.
Dec 04, 2009 05:57 PM|LINK
Yes, all the sources are also up-to-date. You should sync the sources and re-build.
Dec 10, 2009 08:16 PM|LINK
In any cases, I am going to wait for the next update of wincache to try it again in production use. Since the source from which I compiled is the same (I ran a script to compare them), I strongly doubt it will make a difference and our intranet is too important
right now. I wasn't able to reproduce the problem on my dev server even running stress tests. It might be related to some specific script somewhere.
I'll try some more tests on the production server when I have time.
Thank you for your work, I hope most of the issues can be fixed.
Dec 18, 2009 08:53 PM|LINK
A little more information:
It finally happened on my developement server. It happened when I tried sending a file through a POST request which is handled by some PHP scripts. I tried the same thing after restarting the service and it didn't happen that time, so it's very unpredictable.
A screenshot of the state of one hanging PHP process:
Notice that all the PHP process are all below despite restarting IIS.
Here's the stack of the first thread:
It seems to be stuck on WaitForMultipleObjects which conditions to return are never met.
Dec 18, 2009 09:57 PM|LINK
Seems some kind of deadlock. We are working on version 1.0.1 of WINCACHE. I will let you know once we have the release candidate ready so that you can verify it.
Thanks for reporting this issue and helping us make WINCACHE a better caching solution.
Jan 24, 2010 04:08 AM|LINK
We believe we have a solution for that. We are in the process of releasing WINCACHE 1.0.1 version with this fix. It will be good if you can test the private version of WINCACHE with the fix. This will be a win-win situation for both of us as you will get
a chance to ensure that the fix is indeed working for you and if not we can address your concern too so that you can run WINCACHE smoothly. For us, it will be great to have a real customer validation. We have already got it validated by few customers. it would
be great if you can help us in making WINCACHE a great caching solution on WINDOWS.
For getting the privates, please mail me at DONRAMAN[@]MICROSOFT[dot]COM and let me know if you need the privates for PHP 5.2 or PHP 5.3.
Again thanks in advance for helping us.
Jan 26, 2010 05:11 PM|LINK
The problem seems to be solved so far, it passes a stress test that always caused the issue.
I still have one little problem though: Sometimes, after a stress test, I am unable to restart IIS as IIS is unable to stop any of the php processes which I have to terminate manually. However, I can still navigate the site before restarting the service.
Jan 26, 2010 05:53 PM|LINK
Thank you a lot for providing feedback. We have released the WINCACHE 1.0.1 version and it can be found at
I will dig into your other problem. I have never faced that. BTW, if you just leave the machine/site idle for sometime the PHP process should go away automatically. Just check if this is happening or not. This will happen based on what value has been set
foe Idle Timeout.