Re: APC & __autoload & webclusters
| From: | Richard Lynch | Date: | Thu, 21 Feb 2008 16:30:13 +0000 |
| Subject: | Re: APC & __autoload & webclusters | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-269792@lists.php.net to get a copy of this message | ||
On Thu, February 21, 2008 9:27 am, Jochem Maas wrote:
> 1. __autoload & APC
>
> I have been STW to try and find a definitive answer as to whether
> using __autoload with APC
> is a bad idea ... and if so why? ... I can't find that definitive
> answer, can anyone here
> state whether this it's an absolutely bad idea to use __autoload with
> APC? (I need to
> speed up an app that currently loads in pretty much everything on
> every request ... and it's
> impossible to untangle the class interdependencies, in the time I
> have, and thereby load only
> what is absolutely needed, when it's needed ... so I want to give
> __autoload() a shot in order
> to minimize what classes are loaded.
If it's that inter-tangled, then I would hazard a WILD GUESS that the
__autoload will still end up loading everything...
> 2. webclusters & APC
>
> I'm building a load-balanced cluster for the same app ... a certain
> times new data is imported
> from a thirdparty system after which some APC cached data needs to be
> cleared, in the same vein
> I occasionally roll out a new version and then the APC opcode cache
> needs to be cleared (each webserver
> in the cluster has it's own APC cache obviously).
>
> now I'm stuck with the problem of how to trigger the cache clearance
> on all servers ... Greg Donald
> already mentioned the ruby based capistrano for executing commands on
> multiple remote servers and I'll
> be using that to manage things like cache clearance, webserver
> restarting, etc on all the webservers
>
> ... BUT I have found that it is not possible to control the APC cache
> of php_mod from the CLI version of
> php, they apparently use different APC caches. it seems that the only
> way to control the APC cache of
> mod_php is via a web interface. APC ships with the very handy apc.php
> script but this is hardly a decent
> way of controlling/clearing the APC cache of multiple machine
> programmatically.
>
> Am I stuck with one of:
>
> 1. doing a graceful restart of all servers (which causes APCs cache to
> disappear)?
Yes, that should work.
> 2. writing a cmdline script that performs a URL request to a copy of
> apc.php that is reachable via each
> webserver in order to clear/manage the APC cache?
Yes, but obviously password-protect it to avoid DOS.
> or is there another way that I can control the webserver's APC cache
> from the cmdline?
One would think there would be some kind of USR_* signal that can be
sent through Apache to APC to clear cache...
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?