Re: APC & __autoload & webclusters

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

 



Nathan Nobbe wrote:
On Thu, Feb 21, 2008 at 12:01 PM, Jochem Maas <jochem@xxxxxxxxxxxxx> wrote:

Richard Lynch schreef:
If it's that inter-tangled, then I would hazard a WILD GUESS that the
__autoload will still end up loading everything...
but not on every request ;-) ... I do use output caching, and I know
not everything is actually used in every request.


i think youre good to go w/ autoload not loading everything up, but what
about existing include / require directives?  if the code doesnt already
use __autoload() its almost certainly strewn w/ these.  so i think if you
want the boost from __autoload, not loading up everything, youll at least
have
to strip these out.

I know - but it's a rubbish solution because it offer no control as to what
is cleared from the APC cache, sometimes I want to clear opcodes,
sometimes user-data,
sometimes both ... graceful means being forced to clear everything.


you can pass a parameter to apc_clear_cache()
http://www.php.net/manual/en/function.apc-clear-cache.php
that distinguishes what you want to clear; user data or cached opcode.
obviously calling it from the cli will not clear the webserver user cache
though.

One would think that there was something like this indeed - I cannot find
it,
but then there must be something ... I assume, for instance, that Yahoo!**
occassionally
see fit to clear APC caches on more than one machine and I doubt Rasmus
sits there and
opens a browser to run apc.php on each one ;-)


i dont know how yahoo does it, but i do know a little about how facebook
does it; they had
3 speakers at the dc php conference last year.  i think you might find these
slides helpful,
(sorry for the ridiculuus url)
http://www.google.com/url?sa=t&ct=res&cd=1&url=http%3A%2F%2Ftekrat.com%2Ftalks_files%2Fphpdc2007%2Fapc%40facebook.pdf&ei=tce9R9T4FqrszATeiZG6CA&usg=AFQjCNF_1Ecm2cL1EINgRQG9k3fTEclzpA&sig2=ifrJK545M2liBdXbRrHrIw

you can use capistrano to deploy the new files; but it may be more
convenient to use php
and http requests to update all the server caches; *just a thought*.

there are optimizations that are possible as well, such as setting,
apc.stat=0 and
using apc_compile_file() rather than clearing the entire cache, but these
techniques add
complexity.  it sounds like you just want to get a decent bumb w/o too much
additional
complexity, so i wouldnt recommend them here, but i thought id mention them
in passing..

-nathan


Nathan,

cheers for the link to facebook pdf, just had a read and it's good stuff, also lead me on to this after a short google:

http://sizzo.org/wp/wp-content/uploads/2007/09/facebook_performance_caching.pdf

*wanders off for a couple of hours on php.net/apc*

Nathan:
almost march 14th :D

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[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