Re: Problem using APC

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Sep 10, 2008 at 11:38 PM, David Park <dparkmit@xxxxxxxxx> wrote:

> Hi All,
>
> I just installed APC on my server that is running PHP and the APC appears
> to
> be randomly crashing.  Below are the symptoms that my server is
> experiencing
> and the configuration of my system.  Has anyone seen this type of problem
> with APC and can you give me any advice to fix it?
>
> *Symptom #1 - APC appears to be stable but then restarts after a couple
> hours with no page requests*
> 1. Reboot server
> 2. Load apc.php.  It shows that the cache is empty except for one or two
> system files.  These are the files that are used to create the apc.php
> page.
> 3. Load some other PHP pages.  And re-load apc.php after each pageview.
>  The
> cache starts filling up with other cached items and the hit rate goes up.
> 4. Leave the server alone for a couple hours.
> 5. Load apc.php.  It shows that the cache is empty.  Also, the cache uptime
> is less than an hour - in other words, the cache appears to have restarted
> itself.


just curious, but have you really seen a reset after a couple of hours of
*inactivity* ?  i used to monitor apc.php closely when we deployed it at my
last job and every time it got past the size of the cache limit; it would
purge the cache.  i think thats very common.  how many files are you trying
to cache?  we needed to allocate roughly 200MB of memory for apc on our
production box to keep somewhere around 1000 files worth of opcode cache in
memory.  obviously theres no standard for files but thats how it worked for
us.

you can write a test script (javascript) to run through and start requesting
all the various files from your webserver; then apc will cache them, and you
can see how many it can hold before the cache needs to be purged.


> *Symptom #2 - APC restarts in the middle of serving some pages*
> 1. Reboot server
> 2. Load apc.php.  It shows that the cache is empty except for one or two
> system files.  These are the files that are used to create the apc.php
> page.
> 3. Load some other PHP pages.  And re-load apc.php after each pageview.
>  The
> cache starts filling up with other cached items and the hit rate goes up.
> 4. On some of the PHP pages, however, apc.php shows that the cache has
> emptied and has started again.


 the only reason i know apc would purge the cache is reaching the limit on
cache size and then getting requests to cache new files.  there may be other
reasons it will automatically purge itself, and that could be something
worth asking on an apc dev list.  one thing you might try is adding some
user variables to the cache via the apc api, http://us.php.net/apc, maybe
you could check to see if those get cleared along w/ the opcode cache.  i
dunno if it really matters, but it could be interesting.

-nathan

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux