I read the following comment:
"AiP workers die when PHP's memory_limit is exceeeded, and AiP will then restart them."
http://news.ycombinator.com/item?id=2544061
Now obviously after a restart the instance will perform slower as classes need to be reloaded etc. Is there a way to hook in some priming script that must be run before that particular AiP instance may be used again. I am mainly thinking about l loadbalanced setups where I can afford to keep a server out of the rotation in order to prevent latency spikes for users.
regards,
Lukas Kahwe Smith
m...@pooteeweet.org
No, I guess that should be sufficient.
One thing though, does the AiP instance block while the constructor is executing?
if you start doing a lot of work in the constructor this could become a problem. Then again I guess one could then simply as a first step remove the given server from the loadbalancer, do the priming and then readd the server to the loadbalancer. however i guess this would all lead to one poor request that caused the memory overflow to wait ages for a response? wonder if there is a graceful way to forward that single request to a different server.
Well… usually, AiP works using pre-fork model, with child-processes starting to accept connections after initialization is finished.
I don't see why there should be any slow requests (less active workers = less requests per second, but request-speed should be the same)
The only possible reason for the slow request is if some initialization happens lazily during request-processing, and not in constructor.
ah ok .. so as long as i do the priming inside the constructor i am fine? sounds good .. even great! :)