php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #57677 apc_fcntl_lock failed: ressource deadlock avoided
Submitted: 2007-05-18 17:33 UTC Modified: 2007-05-19 22:42 UTC
From: contact at carat-hosting dot com Assigned:
Status: Not a bug Package: APC (PECL)
PHP Version: 4.4.4 OS: RHE4.5
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: contact at carat-hosting dot com
New email:
PHP Version: OS:

 

 [2007-05-18 17:33 UTC] contact at carat-hosting dot com
Description:
------------
After few hours, when the cache is full, httpd (apache 2.0.59) returns exit signal Segmentation fault (11) and freeze. I have to restart httpd

If I set APC Off --> no pbm

So I have tried with a higher value for apc.shm_size (512 rather than 128)

One again few mn after the cache is full I have an error in httpd and all requests http freeze

This time the error is
[Fri May 18 23:12:35 2007] [apc-error] apc_fcntl_lock failed: Resource deadlock avoided
[Fri May 18 23:12:35 2007] [apc-error] apc_fcntl_lock failed: Resource deadlock avoided
[Fri May 18 23:13:35 2007] [apc-error] apc_fcntl_lock failed: Resource deadlock avoided
[Fri May 18 23:13:35 2007] [apc-error] apc_fcntl_lock failed: Resource deadlock avoided


APC infos

General Cache Information
APC Version=3.0.14
PHP Version=4.4.4
Server Software=Apache
Shared Memory=1 Segment(s) with 512.0 MBytes
(mmap memory, file locking)
Start Time=2007/05/18 21:39:53
Uptime=1 hour and 12 minutes
File Upload Support=0

File Cache Information
Cached Files=3672 (425.3 MBytes)
Hits=1330629
Misses=3801
Request Rate (hits, misses)=306.70 cache requests/second
Hit Rate=305.82 cache requests/second
Miss Rate=0.87 cache requests/second
Insert Rate=0.87 cache requests/second
Cache full count=0

User Cache Information
Cached Variables=0 ( 0.0 Bytes)
Hits=0
Misses=0
Request Rate (hits, misses)=0.00 cache requests/second
Hit Rate=0.00 cache requests/second
Miss Rate=0.00 cache requests/second
Insert Rate=0.00 cache requests/second
Cache full count=0

Runtime Settings
apc.cache_by_default=1
apc.enable_cli=0
apc.enabled=1
apc.file_update_protection=2
apc.filters	
apc.gc_ttl=3600
apc.include_once_override=0
apc.localcache=0
apc.localcache.size=512
apc.max_file_size=1M
apc.mmap_file_mask=/tmp/apc.sFgZQh
apc.num_files_hint=1024
apc.report_autofilter=0
apc.shm_segments=1
apc.shm_size=512
apc.slam_defense=0
apc.stat=1
apc.stat_ctime=0
apc.ttl=7200
apc.user_entries_hint=4096
apc.user_ttl=7200
apc.write_lock=1


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-05-19 21:26 UTC] contact at carat-hosting dot com
Hi

Thanks, but I'm surely idiot...

So, what is the solution ????

Turn off all TTL ?

In this case what about the files cache on disk ? 
Do I have to delete them manualy ?

Thanks a ton
Pascal
 [2007-05-19 22:24 UTC] contact at carat-hosting dot com
Ok, maybe I found something

In fact on my box the shm is set at 16M by default in /proc/sys/kernel/shmmax

As the APC config example set thre shm to 128 I had let it like this. 

I have changed /proc/sys/kernel/shmmax to set it to 128M

Now I don't have any more Segmentation fault in apache

But I have a High number of "Cache full count".

2314 in 17mn !!!

Normal ???

Here is my new setting :

Runtime Settings
apc.cache_by_default=1
apc.enable_cli=0
apc.enabled=1
apc.file_update_protection=2
apc.filters	
apc.gc_ttl=3600
apc.include_once_override=0
apc.localcache=0
apc.localcache.size=512
apc.max_file_size=1M
apc.mmap_file_mask=/tmp/apc.LAroFi
apc.num_files_hint=1000
apc.report_autofilter=0
apc.shm_segments=1
apc.shm_size=128
apc.slam_defense=0
apc.stat=1
apc.stat_ctime=0
apc.ttl=7200
apc.user_entries_hint=4096
apc.user_ttl=0
apc.write_lock=1

General Cache Information
APC Version=3.0.14
PHP Version=4.4.4
Server Software=Apache
Shared Memory=1 Segment(s) with 128.0 MBytes
(mmap memory, file locking)
Start Time=2007/05/20 04:02:46
Uptime=17 minutes
File Upload Support=0

File Cache Information
Cached Files=967 (111.4 MBytes)
Hits=27140
Misses=3294
Request Rate (hits, misses)=29.61 cache requests/second
Hit Rate=26.40 cache requests/second
Miss Rate=3.20 cache requests/second
Insert Rate=0.94 cache requests/second
Cache full count=2314
 [2007-05-19 22:42 UTC] rasmus@php.net
If your cache full count is that high it simply means that you are trying to cache way more scripts than you have room for.  You need to either increase your shm segment even more, or you need to add apc.filter rules to reduce the amount of code you put in the cache.  Having the cache constantly fill up like that is going to slow things down.

I've changed this to a feature request for APC to do a better job detecting system-level settings like /proc/sys/kernel/shmmax that might interfere.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 06:01:30 2024 UTC