Reputation: 5677
I have been troubleshooting an issue with php-cgi.exe getting hung intermittently,not able go past certain point.Any help will would be appreciated.
IIS 8.5 +php 5.4.25
when the request comes to IIS,I see that it is getting queued.Fast cgi is trying to spawn a new php-cgi.exe process but i see following pattern of hang in the process monitor trace
8:34:23.0975600 PM php-cgi.exe 8112 RegOpenKey HKU\.DEFAULT\SOFTWARE\ODBC\ODBC.INI\ODBC NAME NOT FOUND Desired Access: Read 9/20/2014
8:34:23 PM 00:00:03.3090228 0.0000045
8:34:23.0975645 PM Registry 648 Read
8:34:23.0975789 PM php-cgi.exe 8112 RegQueryKey HKLM SUCCESS Query: HandleTags, HandleTags: 0x0 9/20/2014
8:34:23 PM 00:00:03.3090417 0.0000019
8:34:23.0975808 PM Registry 649 Read
8:34:23.0975891 PM php-cgi.exe 8112 RegQueryKey HKLM SUCCESS Query: Name 9/20/2014
8:34:23 PM 00:00:03.3090519 0.0000032
8:34:23.0975923 PM Registry 650 Read
8:34:23.0976035 PM php-cgi.exe 8112 RegOpenKey HKLM\SOFTWARE\Wow6432Node\ODBC\ODBC.INI\ODBC NAME NOT FOUND Desired Access: Read 9/20/2014
8:34:23 PM 00:00:03.3090663 0.0000077
8:34:23.0976112 PM Registry 651 Read
8:34:23.0980451 PM php-cgi.exe 8112 CreateFile C:\Windows\SysWOW64\odbcint.dll SUCCESS Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened 9/20/2014
8:34:23 PM 00:00:03.3095079 0.0000285
8:34:23.0980736 PM File System 652
8:34:23.0981085 PM php-cgi.exe 8112 QueryBasicInformationFile C:\Windows\SysWOW64\odbcint.dll SUCCESS CreationTime: 8/21/2013 9:16:44 PM, LastAccessTime: 8/21/2013 9:16:44 PM, LastWriteTime: 8/21/2013 9:16:36 PM, ChangeTime: 2/4/2014 7:58:00 PM, FileAttributes: A 9/20/2014
8:34:23 PM 00:00:03.3095713 0.0000038
8:34:23.0981123 PM File System 653 Read Metadata
8:34:23.0981261 PM php-cgi.exe 8112 CloseFile C:\Windows\SysWOW64\odbcint.dll SUCCESS 9/20/2014
8:34:23 PM 00:00:03.3095889 0.0000090
8:34:23.0981351 PM File System 654
8:34:23.0983027 PM php-cgi.exe 8112 CreateFile C:\Windows\SysWOW64\odbcint.dll SUCCESS Desired Access: Generic Read, Disposition: Open, Options: Synchronous IO Non-Alert, Non-Directory File, Attributes: n/a, ShareMode: Read, Delete, AllocationSize: n/a, OpenResult: Opened 9/20/2014
8:34:23 PM 00:00:03.3097655 0.0000215
8:34:23.0983242 PM File System 655
8:34:23.0983651 PM php-cgi.exe 8112 CreateFileMapping C:\Windows\SysWOW64\odbcint.dll FILE LOCKED WITH ONLY READERS SyncType: SyncTypeCreateSection, PageProtection: 9/20/2014
8:34:23 PM 00:00:03.3098279 0.0000032 8:34:23.0983683 PM File System 656
8:34:23.0983949 PM php-cgi.exe 8112 CreateFileMapping C:\Windows\SysWOW64\odbcint.dll SUCCESS SyncType: SyncTypeOther 9/20/2014
8:34:23 PM 00:00:03.3098577 0.0000016
8:34:23.0983965 PM File System 657
8:34:23.0984397 PM php-cgi.exe 8112 CloseFile C:\Windows\SysWOW64\odbcint.dll SUCCESS 9/20/2014 8:34:23 PM 00:00:03.3099025 0.0000070
8:34:23.0984467 PM File System 658
8:34:23.0990797 PM php-cgi.exe 8112 Thread Create SUCCESS Thread ID: 7928 9/20/2014
8:34:23 PM 00:00:03.3105425 0.0000000 8:34:23.0990797 PM Process 659
looking at php-cgi.exe memory dumps,i see
013df45c 1000783f KERNELBASE!WaitForSingleObject+0x12
013df58c 10005594 php_wincache!aplist_ocache_initialize+0xff [c:\php- sdk\php54dev\vc9\x86\pecl\wincache\wincache_aplist.c @ 1116]
013df624 72efa6ed php_wincache!zm_startup_wincache+0x3f4 [c:\php-sdk\php54dev\vc9\x86\pecl\wincache\php_wincache.c @ 790]
013df640 72e7a2fb php5!zend_startup_module_ex+0x4d [c:\php-sdk\php54dev\vc9\x86\php-5.4.25\zend\zend_api.c @ 1696]
013df654 72f0f050 php5!zend_hash_apply+0x1b [c:\php-sdk\php54dev\vc9\x86\php-5.4.25\zend\zend_hash.c @ 716]
013df674 72f00617 php5!zend_startup_modules+0x20 [c:\php-sdk\php54dev\vc9\x86\php-5.4.25\zend\zend_api.c @ 1823]
013df948 00bd2af2 php5!php_module_startup+0x647 [c:\php-sdk\php54dev\vc9\x86\php-5.4.25\main\main.c @ 2223]
013df958 00bd1ac9 php_cgi!php_cgi_startup+0x12 [c:\php-sdk\php54dev\vc9\x86\php-5.4.25\sapi\cgi\cgi_main.c @ 937]
013dfae4 00bd38d1 php_cgi!main+0x1a9 [c:\php-sdk\php54dev\vc9\x86\php-5.4.25\sapi\cgi\cgi_main.c @ 1911]
013dfb28 7702495d php_cgi!__tmainCRTStartup+0x10f
I am not sure what is causing the php-cgi.exe process to get hung right after loading odbc dll. I am seeing all the php-cgi.exe process getting hung with the same behavior.Killing all the php-cgi process will get back everything up.
Upvotes: 0
Views: 946
Reputation: 5677
This is a bug in the wincache module. A fix is in the developer channel.
https://bugs.php.net/bug.php?id=68107
From the bug:
Please pick up 1.3.6.2, which has a fix for this issue.
Additionally, 1.3.6.2 adds a new setting that can be used to disable Shared Reader/Writer (SRW) locks. By default, WinCache uses SRW locks. Disabling them will incur a slight performance hit, but is robust against byzantine failures where php-cgi.exe instances get killed while WinCache is holding a shared lock. The new php.ini setting is:
wincache.srwlocks=0 ; default is 1.
1.3.6.2 is available out on SourceForge in the developer releases folder.
http://sourceforge.net/projects/wincache/files/development/
Upvotes: 1