Keel alive mysql, php and apache2

58 views Asked by At

I am running a Debian server 7, after preforming load testing using Jmeter on my website. I noticed that MySQL was dying after 50 users, PHP was dying after 100+ users and Apache 2 dying after 200+ users. Now my question is what is the best way to restart these services if they are terminated or froze up?

1

There are 1 answers

0
Bizmate On

Restarting a service means killing all its current processes and start a new one. In the meantime you have lost/dropped all the requests from some legitimate users that will eventually see an http error or a timeout when connections are dropped.

I would ask myself, are you happy with 200+ users? Is mysql your bottleneck? Etc.. Use some sort of monitoring service like new relic and as a workaround just restart those services when alerts start coming in, either manually or automatically.

But if you want to improve your site performance deploy your service on a better infrastructure so it can scale up to bigger numbers or improve the code/app architecture used on your site, i.e. put some extra caching between mysql and your application.

Also It would be interesting to know how you have managed to test apache, mysql and php separately especially httpd vs php processes with a tool like JMeter that in my experience sure can test apache separately and mysql separately. But your php and apache scripts are really tightly bound together.