I have some serious problems with my production server running Ubuntu 11.10 with 48GB RAM. The setup of my webserver (Apache 2.1) is configured to use approximately 18 GB of RAM. I tried to calculate this value by setting
- max_clients 800
with each child process taking nearly 23MB ram
- max_spare_servers 200
- keepAlive on
- keepalivetimeout 3
Apache MPM is set to prefork module
Additionally we are using
- php 5.3.2
- PDO to connect to database
I made similar changes to my MySQL server (v5.1) by changing max_used_connections to 800 with
- key_buffer to 4Gb (Myisam as default engine with 3 tables of innodb)
- key_buffer_size + (read_buffer_size + sort_buffer_size ) * max_connections = 5.4Gb
Now max_used_connection is increasing rapidly and after a couple of hours it stopped at 595 and again it climbed to its max value of 800. I even tried changing to default mysql configuration but still no change.
For some reason changing to Apache's default configuration solves the problem now max_used_connections is steady at around 57.
Does anyone have an idea about this behavior? Can Apaches configuration impact Mysql performance?