|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2011-09-06 14:43 UTC] joe dot lencioni at gmail dot com
Description: ------------ Similar to bug #24343, APCIterator fails when working with a large user cache. Our user cache is currently 100663 (858.4 MBytes), and when we try to get some keys and loop over them, it seems that APCIterator fails when calling current(). This problem makes APC unsuitable for working with a large user cache. Reproduce code: --------------- $apcCache = new \APCIterator('user', '`^example-search`', APC_ITER_KEY, 100, APC_LIST_ACTIVE); var_dump($apcCache->getTotalCount(), $apcCache->current()); Expected result: ---------------- int 2 array 'key' => string 'example-search-201213' (length=26) Actual result: -------------- int 2 bool false PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 03:00:02 2025 UTC |
I can reproduce this issue using the following example code: //to fill apc cache (~200MB): for($i=0;$i<50000;$i++) { $value = str_repeat(md5(microtime()), 100); apc_store('test-niko-asdfasdfasdfkjasdflkasjdfasf'.$i, $value); } //then later (usually after a few minutes) this won't work correctly: $it = new ApcIterator('user', '#^test-niko-asdfasdfasdfkjasdflkasjdfasf#'); var_dump($it->getTotalCount()); //returns 50000 var_dump($it->current()); //returns false