Once on my blog server found such a problem, every few days the MySQL service process will be inexplicably disappeared. The problem lasted a very long time, and it took me half a month to do it, because every time a problem occurred, it was a few days after the normal operation.
I realized that there might be a problem with my MySQL database. Use putty to connect to my server, use the top command, and then press the SHIFT+M key in memory size to see the mysqld process. Open the System log file (Cat/var/log/mysqld.log), found in the afternoon when the memory alarm occurred, then the system killed the largest memory of the MySQL process, to alleviate the server pressure.
Restart the MySQL process and use the top command to stare at what has changed in the list of processes on the server. 10 minutes or so, abnormal appearance, a lot of httpd process came out. And each process occupies about 2%-3% of the memory, until MySQL was killed again, the server was launched on the httpd process has reached more than 30, about 80% of the memory, plus mysqld occupy about 20%, almost no memory can be allocated. The original problem appeared on Apache.
Talk about how Apache works here. Apache has two modes of operation, one is Prefork mode and the other is worker mode. Each of these two modes has its advantages, and each connection in Prefork mode creates a process, one-to-one. Worker mode a process that corresponds to multiple connections, using threads for processing, many-to-one.
However, it is cumbersome and unsafe to modify Apache's working mode. Modification is not advocated. Or honestly optimize the prefork mode.
Database mysqld process has been repeatedly killed, really just the problem of MySQL?