Re: APC Shared Memory Behaviour
| From: | Rasmus Lerdorf | Date: | Thu, 08 Sep 2005 04:16:22 +0000 |
| Subject: | Re: APC Shared Memory Behaviour | ||
| References: | 1 | Groups: | php.pecl.dev |
| Request: | Send a blank email to pecl-dev+get-2875@lists.php.net to get a copy of this message | ||
Scott MacVicar wrote:
> One 32mb segment allocated in shared memory
> Insert some data from scripts into shared memory
> Scripts get cached in shared memory
> Update data from scripts in shared memory. (failure)
>
> The failure would occur as all of the scripts had used up the remaining
> free allocated memory so updating would fail.
>
> How does APC handle this situtation? Does it keep seperate caches for
> user stored shared memory and scripts? Or does a sort of global cleanup
> get run on scripts when memory gets full?
It doesn't have a separate cache for the user data. It shares and uses
the TTL to determine what to clean up when it runs out of space. Any
opcode entries that haven't been accessed for the last ttl seconds will
be deleted and any user entries not accessed for the last user_ttl
seconds will also be deleted if the cache fills up.
You could also just allocate a larger shared memory segment, of course.
-Rasmus