1. MySQL max_connections should large than Apache max_clients.Ex: if max_connections of MySQL is 330 then Apache max_clients will be below 330, like 300 or something.Severlimits of apache will be similar like max_clients.
2. You can determine max_clients of apache depends on your RAM. If RAM is 2GB then around 350 is a good number. I tell this number specifically for dedicated linux server.You can change the default value of startservers 8 into 30.Apache webserver is now getting more load.Apache 2.2.x webserver works on prefork model and all change will do in this module section. Below I just give the proven numbers of Apache tuning for 2GB RAM. Do this parameter change into "Prefork.c" section
StartServers 30
MinSpareServers 20
MaxSpareServers 30
ServerLimit 330
MaxClients 330
MaxRequestsPerChild 4000
3. For large data table, use InnoDB engine. Eventually MyISAM engine is more faster than InnoDB but it may crash if MySQL server don't handle request properly.
4. If you see MySQL become slow to handle the request, then both MySQL and Apache server need to restart.Remember MySQL server should restart first.
These four tips are exclusively should follow during apache-mysql tuning. There are other some extra tuning work like keepalive "On" instead of "Off". Apache now recommend to On this parameter. Also less time parameter should set for KeepAliveTimeout. By default it set 15 sec.You can set it 4 sec or 6 sec depends on your bandwidth and RAM.Another thing is that disable those modules which you dont need to load in apache now.See all the "Loadmodule" list in httpd.conf file.Just enable which you need and rest of the modules should disable.Apache become more faster to handle request.
Have a nice day.Enjoy!
