APC + PHP Problem (apc_fcntl_lock failed: Bad file descriptor)
| From: | Scott McNaught [Synergy 8] | Date: | Mon, 02 Jun 2008 03:28:45 +0000 |
| Subject: | APC + PHP Problem (apc_fcntl_lock failed: Bad file descriptor) | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-274917@lists.php.net to get a copy of this message | ||
Hello,
I am running a production server with APC and php. We recently had a crash
where APC bombed out. When it does this, the server serves empty, white
pages.
Here is what the error_log says.
[Mon Jun 2 11:20:36 2008] [apc-error] apc_fcntl_lock failed: Bad file
descriptor
[Mon Jun 02 11:20:37 2008] [notice] child pid 6104 exit signal Segmentation
fault (11)
[Mon Jun 2 11:20:40 2008] [apc-error] apc_fcntl_lock failed: Bad file
descriptor
[Mon Jun 2 11:20:40 2008] [apc-error] apc_fcntl_lock failed: Bad file
descriptor
[Mon Jun 2 11:20:41 2008] [apc-error] apc_fcntl_lock failed: Bad file
descriptor
[Mon Jun 2 11:20:41 2008] [apc-error] apc_fcntl_lock failed: Bad file
descriptor
[Mon Jun 2 11:20:41 2008] [apc-error] apc_fcntl_lock failed: Bad file
descriptor
[Mon Jun 2 11:20:42 2008] [apc-error] apc_fcntl_lock failed: Bad file
descriptor
[Mon Jun 2 11:20:43 2008] [apc-error] apc_fcntl_lock failed: Bad file
descriptor
[Mon Jun 2 11:20:45 2008] [apc-error] apc_fcntl_lock failed: Bad file
descriptor
[Mon Jun 2 11:20:45 2008] [apc-error] apc_fcntl_lock failed: Bad file
descriptor
...
And so it goes on until apache was restarted.
I have not yet found a resolution for this. There are no calls made to
apc_store() on the server. It is solely script caching.
I have seen bug reports on this:
http://pecl.php.net/bugs/bug.php?id=4769
http://pecl.php.net/bugs/bug.php?id=9745
After looking at these, I think what is happening is the cache is filling
up, and when it expunge()s it gets in a loop, php kills the process after
the 30sec timeout, and the lock is left. Then no more subsequent requests
can be served.
Has anyone else experienced this, and does anyone know of a fix for this?
I am running PHP 5.2.5, and APC 3.0.15. This is the PHP info for APC.
APC Support enabled
Version 3.0.15
MMAP Support Enabled
MMAP File Mask no value
Locking type File Locks
Revision $Revision: 3.151 $
Build Date Oct 29 2007 19:02:05
Directive Local Value Master Value
apc.cache_by_default On On
apc.enable_cli Off Off
apc.enabled On On
apc.file_update_protection 2 2
apc.filters no value no value
apc.gc_ttl 3600 3600
apc.include_once_override Off Off
apc.localcache Off Off
apc.localcache.size 512 512
apc.max_file_size 1M 1M
apc.mmap_file_mask no value no value
apc.num_files_hint 1000 1000
apc.report_autofilter Off Off
apc.rfc1867 Off Off
apc.rfc1867_freq 0 0
apc.rfc1867_name APC_UPLOAD_PROGRESS APC_UPLOAD_PROGRESS
apc.rfc1867_prefix upload_ upload_
apc.shm_segments 1 1
apc.shm_size 30 30
apc.slam_defense 0 0
apc.stat On On
apc.stat_ctime Off Off
apc.ttl 0 0
apc.user_entries_hint 4096 4096
apc.user_ttl 0 0
apc.write_lock On On