2011-07-28 39 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

有没有在事件日志中任何看起来相关? –