2011-07-28 48 views
1

我的IIS非常不穩定,因爲它總是因爲某些原因與APC相關而重新啓動。Windows上的APC不穩定

服務器的規格低於

Intel R Xeon CPU 3GHZ 3GHZ 
2GB RAM 
64bit 

APC &服務器規格

3.1.7-dev 
PHP Version 5.3.6 
APC Host localhost 
Server Software Microsoft-IIS/7.5 
Shared Memory 1 Segment(s) with 1024.0 MBytes 
(IPC shared memory, File Locks locking) 



extension=php_apc.dll 
apc.shm_size=1024M 
apc.num_files_hint=10000 
apc.user_entries_hint=10000 
apc.max_file_size=5M 

PHP日誌文件上的錯誤

28-Jul-2011 09:23:14] PHP Fatal error: Unknown: apc_fcntl_lock failed errno:6 in Unknown on line 0 
[28-Jul-2011 09:23:14] PHP Fatal error: Unknown: apc_fcntl_lock failed errno:6 in Unknown on line 0 
[28-Jul-2011 09:24:23] PHP Notice: Undefined index: SERVER_ADDR in C:\inetpub\wwwroot\apc.php on line 68 
[28-Jul-2011 09:24:24] PHP Notice: Undefined index: SERVER_ADDR in C:\inetpub\wwwroot\apc.php on line 68 
[28-Jul-2011 09:24:24] PHP Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'UTC' for '8.0/no DST' instead in C:\inetpub\wwwroot\apc.php on line 1122 
[28-Jul-2011 09:24:24] PHP Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'UTC' for '8.0/no DST' instead in C:\inetpub\wwwroot\apc.php on line 1123 
[28-Jul-2011 09:24:24] PHP Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'UTC' for '8.0/no DST' instead in C:\inetpub\wwwroot\apc.php on line 1124 
[28-Jul-2011 09:24:30] PHP Notice: Undefined index: SERVER_ADDR in C:\inetpub\wwwroot\apc.php on line 68 
[28-Jul-2011 09:24:30] 

我想不出那是什麼是錯誤導致IIS重新啓動或導致apc_fcntl_lock失敗errno:6。 我的項目可存儲多達1GB的緩存數據,從而解釋了SHM設置爲1024M

而且問題似乎當我重新加載瀏覽器 HTTP錯誤500.0 apc.php頁面更頻繁地發生 - 內部服務器錯誤 C:\ PHP \ PHP-cgi.exe文件 - FastCGI進程意外退出

我的緩存被重置,我已經再次重新緩存我的數據。

它適用於我的LINUX服務器。我的APC配置是否有問題?

回答

1

我不認爲這與您的APC配置本身有問題,但更可能是在Windows上處理文件鎖定方式的問題。我查閱了APC源代碼中的apc_fcntl_lock,它非常簡單直接,並且幾個月前一直沒有改變。

如果你只運行一個工作進程,你可以嘗試設置apc.write_lock = 0,看看是否有幫助。

否則,你可以嘗試PHP的(或任何5.3.7RC3)的情況下,舊版本的問題是與APC與PHP交互的方式(可能是不可能的,雖然)。

最後,如果這不起作用,也許嘗試一個不同的操作碼緩存;例如xcache。

+0

它解決了apc_fcntl_lock失敗的errno:6錯誤我設置了apc.write_lock = 0和apc.localcache = 1.但是,我仍然得到HTTP錯誤500.0 - 內部服務器錯誤C:\ PHP \ php-cgi.exe - FastCGI進程上occassions我一直不知道爲什麼會發生意外退出,php的日誌文件犯規顯示任何錯誤信息 – flyclassic

+0

有沒有在事件日誌中任何看起來相關? –