[TYPO3-dev] cache framework - exception in apc backend when no space is left

Andreas Kiessling kiessling at pluspol.info
Tue Nov 2 13:47:02 CET 2010


Hi,

On 02.11.2010 13:23, Steffen Gebert wrote:
> On 02.11.10 13:06, Dominique Feyer wrote:
>> I think using opcode cache to cache user data is not a good idea, switch
>> to memcache or an other dedicated caching system for user data.
>
> Isn't it a feature of APC, being not *only* an opcode cache, but also a
> persistent store (persistent between requests)?

Exactly. I don't know if memcache makes much sense on a single server 
and since there is a cache backend for APC and we have it already 
installed on the server, i just tried it out.

>
> I wonder why this code doesn't throw an exception:
>> $success = apc_store($this->identifierPrefix . $entryIdentifier,
>> $data, $expiration);
>> if ($success === TRUE) {
>> $this->removeIdentifierFromAllTags($entryIdentifier);
>> $this->addIdentifierToTags($entryIdentifier, $tags);
>> } else {
>> throw new t3lib_cache_Exception(
>> 'Could not set value.',
>> 1232986877
>> );
>> }
> Isn't this the piece of code, which you described?
> Christan "the cache" Kuhn, what do you think? Reading the code, I really
> wonder why no exception is thrown.
>

That's exactly the piece of code i was referring to.
On a Debian Lenny running PHP 5.2.6-1 and APC 3.0.19 (from the Debian 
repo), this returned FALSE and so showed me the exception when the cache 
was full. But when the exception tells you, that it could not set the 
value, it isn't obvious that you are running out of space ;)

There's no problem, if you have set enough memory for APC. I tried to 
reproduce the error on my local setup (PHP 5.3.3 and APC 3.1.4 from 
Macports) but it didn't show up. I will try again this evening and set 
it to an even lower value.

Regards,
Andreas




More information about the TYPO3-dev mailing list