multiple segments of shared memory?
[email protected] (Alexander Romanovich) Tue, 8 Feb 2011 11:32:34 -0500
| Newsgroups | php.apc.dev |
|---|---|
| Message-ID | <[email protected]> |
--Apple-Mail-18-1047974427
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
charset=windows-1252
Is there any way to use segmented pools of shared memory in APC? In =
other words, as far as I can tell, all apc_add() calls store their =
values in a single pool of memory whose size is set in php.ini. However, =
I'd love to be able to set a limit on how much data a particular =
apc_add() call can store, separate from the global limit. Something like =
this:
$m=3Dapc_create_segment('32MB'); // create a segment of memory from the =
global memory space, with a cap of 32MB
apc_add('foo','bar',300,$m);
echo apc_fetch('foo');
This would seem to open up a whole new area of optimizations, because =
then you can put a cap on a specific variable in your application, that =
would allow shared memory to be utilized up to a point while allowing =
the remainder of the global shared memory to remain free for more =
critical data to be stored.
I know apc_inc() and apc_dec() could help me place a cap on the number =
of times a particular type of variable could be stored, but this is not =
satisfactory because 1) the data being stored might be of variable =
length, and I'd want a cap on the memory being used rather than the =
number of values being stored and 2) there's the overhead of constantly =
calling apc_inc()/apc_dec() just to keep track of cache usage.
------------------------------------------------------------------
Alexander Romanovich =95 [email protected]
Technical Director
White Whale Web Services, Inc.
--Apple-Mail-18-1047974427--