Sometimes my website 'goes down' due to Mysql consuming all the resources, but I think it does not stop creating more httpd processes. Is that possible? If I restart apache, these processes disappear and I can see the CPU consumption by the mysql process go down slowly, and then the site is online again.
I'm having trouble finding the bottleneck anyway. The site has a lot of cronjobs (php scripts), and each one generates logs, which include the total execution time.
So my first thought was to try to find the script that took a lot of time, but that was not possible because it takes only one of them slowing the mysql server, to have all of them increasing their execution time.
Any advice?
Where can I learn how to find the bottlenecks?
Note: I'm on CentOS, apache 2, php 5.3, and mysql 5