|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2008-06-03 17:28 UTC] nathanlevingreenhaw at gmail dot com
Description: ------------ This is possibly similar to Bug #13529 (if so, the issue is not resolved with 3.0.19). PHP verison 5.2.6 Apache version 1.3.41 APC configuration (from phpinfo()): APC Support enabled Version 3.0.19 MMAP Support Enabled MMAP File Mask no value Locking type File Locks Revision $Revision: 3.154.2.5 $ Build Date May 29 2008 06:23:14 When I start Apache, I see that there are 7 APC file pointers: # lsof -p `ps -e | grep httpd | tail -n 1 | awk '{print $1}'` | grep apc httpd 11209 www_serv mem REG 58,0 808987 752623 /lib/php_apc.so httpd 11209 www_serv 3u REG 8,5 0 208445 /tmp/.apc.YIPzXw (deleted) httpd 11209 www_serv 4u REG 8,5 0 208446 /tmp/.apc.hy2eqL (deleted) httpd 11209 www_serv 5u REG 8,5 0 209353 /tmp/.apc.ltIKeV (deleted) httpd 11209 www_serv 6u REG 8,5 0 211777 /tmp/.apc.GDmUSZ (deleted) httpd 11209 www_serv 7u REG 8,5 0 211778 /tmp/.apc.73VVui (deleted) httpd 11209 www_serv 8u REG 8,5 0 211779 /tmp/.apc.zxyAle (deleted) httpd 11209 www_serv 9u REG 8,5 0 211780 /tmp/.apc.Rn1gOs (deleted) Then if I restart Apache, there are 10 APC files: # apachectl restart # lsof -p `ps -e | grep httpd | tail -n 1 | awk '{print $1}'` | grep apc httpd 11314 www_serv mem REG 58,0 808987 752623 /lib/php_apc.so httpd 11314 www_serv 3u REG 8,5 0 208445 /tmp/.apc.9wtmIW (deleted) httpd 11314 www_serv 4u REG 8,5 0 208446 /tmp/.apc.0MjtCq (deleted) httpd 11314 www_serv 5u REG 8,5 0 209353 /tmp/.apc.ltIKeV (deleted) httpd 11314 www_serv 6u REG 8,5 0 211777 /tmp/.apc.GDmUSZ (deleted) httpd 11314 www_serv 7u REG 8,5 0 211778 /tmp/.apc.73VVui (deleted) httpd 11314 www_serv 8u REG 8,5 0 211779 /tmp/.apc.9TlAwU (deleted) httpd 11314 www_serv 9u REG 8,5 0 211780 /tmp/.apc.Rn1gOs (deleted) httpd 11314 www_serv 10u REG 8,5 0 211781 /tmp/.apc.bnjIqo (deleted) httpd 11314 www_serv 11u REG 8,5 0 211782 /tmp/.apc.GJlQkS (deleted) Every time Apache is restarted (via 'restart' or 'graceful') Apache accumulates two more APC file pointers. After Apache has accumulated enough file pointers it will crash. Let me know if I can provide you any other useful information. Reproduce code: --------------- #!/bin/bash echo -n "Start value: " lsof -p `ps -e | grep httpd | tail -n 1 | awk '{print $1}'` | grep apc | wc -l apachectl restart echo -n "After restart: " lsof -p `ps -e | grep httpd | tail -n 1 | awk '{print $1}'` | grep apc | wc -l Expected result: ---------------- The values for each line are the same. Example: Start value: 8 After restart: 8 Actual result: -------------- Start value: 8 After restart: 10 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 01:00:01 2025 UTC |
I am using mod_php. I /think/ I might have located the problem. I noticed in apc_cache_create() that CREATE_LOCK() could get called twice if NONBLOCKING_LOCK_AVAILABLE is set. So, I changed apc_cache_destroy() to be: void apc_cache_destroy(apc_cache_t* cache) { //DESTROY_LOCK(cache); apc_lck_destroy(cache->header->lock); #if NONBLOCKING_LOCK_AVAILABLE apc_lck_destroy(cache->header->wrlock); #endif apc_efree(cache); } and that seems to prevent the extra files from building up. I do not completely grok everything in the code, so I am not sure if that change is the most appropriate or not.