|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2008-02-19 03:53 UTC] apc at tequilasolutions dot com
Description: ------------ Hi there, I store lots of small user cache items, mostly caching results from slow function calls, I get high fragmentation despite a large cache size and it slows the server down so you get less benefit from using the cache. Though not technically a bug perhaps but any tips to avoid frags? should I pad data to certain sizes? Cheers, J. Reproduce code: --------------- http://web02.tequilasolutions.com/apc_cache.php Expected result: ---------------- Some sort of defrag. Actual result: -------------- High frags even with buckets of space left in the cache. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 05:00:02 2025 UTC |
assuming you have json on your machine, I'd like you to run <?php header("Content-Type: text/json"); echo json_encode(apc_sma_info()); ?> on that server and sort of give me numbers. Everytime some struct changes size, something like http://t3.dotgnu.info/blog/php/apc-and-40bytes.html happens (which why I need stats to analyze)@petitchevalroux: apc-3.1.2 has an apc_inc/apc_dec which works on long/int vals stored in APC. So, instead of $a = apc_fetch("127.0.0.1"); apc_store("127.0.0.1", $a + 1); you could just apc_inc("127.0.0.1"); And it'd updated in-place without the "allocate new, copy, deallocate old" approach which the other one requires.