|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2010-09-13 06:38 UTC] crejob at gmail dot com
Description: ------------ After upgrading to php 5.3.3 and apc 3.1.4 from php 5.3.2 and php 3.1.3p1 one very bad thing happened: I see lot of duplicate entries in "User Cache Entries", and they fill whole cache after some time (it depends on load and apc.shm_size), resulting warnings "Unable to allocate memory for pool" like in bug #16966 (which are fatal for my application with php error_handler that dies after any warning). In apc.php report "User Cache Entries" filtered by "foo" keyword and sorted by "last accessed", descending: foo 0 648 2010/09/13 14:11:26 foo 0 648 2010/09/13 14:10:07 foo 0 648 2010/09/13 14:10:06 foo 0 648 2010/09/13 14:10:05 foo 0 648 2010/09/13 14:10:04 foo 0 648 2010/09/13 14:10:03 foo 0 648 2010/09/13 14:10:02 ... "Last modified" and "created at" columns are the same as "last accessed" PHP Info: Linux 2.6.32-5-amd64 #1 SMP Tue Jun 1 04:34:03 UTC 2010 x86_64 Apache/1.3.42 PHP 5.3.3 PHP API 20090626 PHP Extension 20090626 Zend Extension 220090626 Zend Extension Build API220090626,NTS PHP Extension Build API20090626,NTS Debug Build no Thread Safety disabled APC Version 3.1.4 MMAP Support Enabled MMAP File Mask no value Locking type pthread mutex Locks Revision $Revision: 301663 $ php.ini [apc] extension = /usr/local/php5/lib/php/extensions/no-debug-non-zts-20090626/apc.so apc.shm_size = 256M apc.ttl = 7200 apc.user_entries_hint = 65536 apc.slam_defense = 0 slam_defense disabled because of bug #16814 (warnings "Potential cache slam averted for key ..."), and the code below, perhaps, corresponds to that bug more than to this one (but results in apc.php report with duplicate variables, described above, are reproductible this way). Reproduce code: --------------- test.php: for ($i = 0; $i<100; $i++) { echo apc_store('foo', $i, 0); echo ' '.apc_fetch('foo').'<br>'; } Expected result: ---------------- 1 0 1 1 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 9 ... Actual result: -------------- 1 1 1 1 1 3 1 1 5 1 1 7 1 1 9 1 1 11 1 1 13 1 1 15 1 1 17 1 1 19 1 1 21 1 1 23 1 1 25 1 1 27 1 1 29 1 30 1 31 1 32 1 33 1 34 1 35 ... Time to time result differs - only once I saw expected result, more frequently there was something like: 1 1 1 1 1 3 1 1 5 1 6 1 7 ... PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 03:00:02 2025 UTC |
There seems to be another problem that seems to be hinted above - apc_store() is storing a 'false' value, usually after the user cache has been cleared. Even more frustrating, it seems to be intermittent, but can be reproduced by doing: apc_store('foo', 'bar', 3600); then: apc_clear_cache('user'); and again: apc_store('foo', 'bar', 3600);I found this bug report because I was looking to see if anyone has the answer to this problem. All I can do is to add "me too" to this thread. Using php 5.3.3 with APC 3.1.4 I have 2 different server setups: once Apache with mod_php and another one is Lighttpd with php-fpm based factcgi. Both of these setups have duplicate entry issues. I am using APC only to cache php classes, not using it to cache anything by keys, I have memcache for that. Example: [3] => Array ( [filename] => /usr/local/apache/sites/apacheserver/htdocs/!inc.php [device] => 2051 [inode] => 37686147 [type] => file [num_hits] => 3 [mtime] => 1288646012 [creation_time] => 1288646047 [deletion_time] => 0 [access_time] => 1288646140 [ref_count] => 0 [mem_size] => 119112 ) [4] => Array ( [filename] => /usr/local/apache/sites/apacheserver/htdocs/!inc.php [device] => 2051 [inode] => 37686145 [type] => file [num_hits] => 1 [mtime] => 1288641935 [creation_time] => 1288642030 [deletion_time] => 0 [access_time] => 1288642032 [ref_count] => 0 [mem_size] => 114984 ) [5] => Array ( [filename] => /usr/local/apache/sites/apacheserver/htdocs/www/index.php [device] => 2051 [inode] => 37686144 [type] => file [num_hits] => 3 [mtime] => 1288643813 [creation_time] => 1288646047 [deletion_time] => 0 [access_time] => 1288646140 [ref_count] => 0 [mem_size] => 28840 ) [6] => Array ( [filename] => /usr/local/apache/sites/apacheserver/htdocs/www/index.php [device] => 2051 [inode] => 37686143 [type] => file [num_hits] => 0 [mtime] => 1288640054 [creation_time] => 1288640063 [deletion_time] => 0 [access_time] => 1288640063 [ref_count] => 0 [mem_size] => 28840 )