php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #58085 Cache full count increments even if sufficient memory is available
Submitted: 2008-03-07 11:36 UTC Modified: 2009-03-14 00:35 UTC
From: thejo at thejo dot in Assigned:
Status: Closed Package: APC (PECL)
PHP Version: 5.2.1 OS: OpenSuse 10.0
Private report: No CVE-ID: None
 [2008-03-07 11:36 UTC] thejo at thejo dot in
Description:
------------
The cache full count is incrementing to large values even if sufficient memory is available. This happens when apc_add is used to lock access to a user cached variable. The locking code I use is similar to the one described in this bug report - 
http://pecl.php.net/bugs/bug.php?id=12688

I'm not sure if it's ok to use APC in this way to synchronize access to a shared variable.

Reproduce code:
---------------
To reproduce this bug, please use the code at -
http://thejo.in/php/cache_full.txt

Clear opcode cache or restart apache and check that the cache full count is 0 in the APC management console. Ensure that sufficient memory has been allocated (I have 32 MB allocated)

Use http_load to make concurrent requests to the script - 
http_load -parallel 10 -fetches 1000 urls.txt

where urls.txt could contain the following url multiple times - 
http://127.0.0.1/cache_full.php

Once http_load has finished, check the cache full count in the APC management console

Expected result:
----------------
The cache full count should be 0.

Actual result:
--------------
The cache full count is a very large value (in the tens of thousands)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-03-29 01:40 UTC] rasmus@php.net
This should be fixed in CVS now.

If you are able to, please test by checking out:

cvs -d:pserver:cvs.php.net:/repository co -r APC_3_0 pecl/apc

and building that.
 [2008-03-31 05:23 UTC] thejo at thejo dot in
Tested with version 3.0.18. The cache full count is not incrementing. Thanks for the fix!
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat Oct 25 03:00:01 2025 UTC