Well, this is a general apc question,

I installed apc and everything works fine but after every two hours it clears the cache automatically and starts caching everything again.

I thought it was the ttl issue but I have tried everything and nothing seems to work with the time values.

Could it have anything to do with session's gc mechanism? though I doubt that !

Any responses would be much appreciated!

Comments

Anonymous’s picture

Without seeing it, it is pretty much impossible to guess what might be going on. You could also post the report provided when you point your browser to apc.php, this could also provide some clues.

alihammad’s picture

Thanks for the response. I kinda figured it out.

It wasn't the apc's fault. APC works just fine.

It turned out to be a script on my server which was automatically restarting my apache server every few hours to dump logs, killing unresponsive stuff, etc !

Apparently this customized script (a webmin fork I think) cannot work without this feature. As annoying as it may be, I think I have to just let it go!

At the moment re-caching with apc after server restart doesn't take too much resources but if it reaches the point of overburdening the system then I guess we will have to move away from the script!

alihammad’s picture

But I was wondering if there was a way for the apc to save the entire cache on disk just before the server shut down and then possibly loading it back to the ram after the server had restarted ?

Few people have suggested file cache; mechanisms like using output buffer to dump the entire output to file and show it in place of executing the php code. Honestly, they all seem like unsuitable hacks and are in no way comparable to opcode caching where the dynamic nature of the results remain intact!

Though I would be very interested in finding a way to save the opcode cache in a way where server restarts do not affect it. Is there a way ?