Re: apc and cli

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

 



On Dec 12, 2007 2:33 PM, Ravi Menon <jravimenon@xxxxxxxxx> wrote:

> Hi,
>
> We have long running daemons written in php ( cli, non-apache
> contexts) with the typical pattern:
>
> while( !$shutdown )
> {
>    $c = new SomeClass;
>
>    $c->process();
> }
>
> For performance reasons, would it help if apc.enable_cli is turned on:
>
>  apc.enable_cli  integer
>
>    Mostly for testing and debugging. Setting this enables APC for the
> CLI version of PHP. Normally you wouldn't want to create, populate and
> tear down the APC cache on every CLI request, but for various test
> scenarios it is handy to be able to enable APC for the CLI version of
> APC easily.
>
>
> I am slightly confused by the statement - 'Mostly for testing and
> debugging.....' .
>
> On each loop iteration, does php recompile the code in 'SomeClass' (
> and all its dependencies ) or it is really cached ( as it has seen the
> class code once ).
>
> If there is a php internals document on such issues, do let me know.
>

i think the cache is alive for the duration of the parent process.
typically cli
scripts are brief.  however, if you have a long running cli script apc might
be
useful in the context of the cli.
ive been curious about this myself.  if anyone has a definitive answer, im
looking forward to it.

-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