joeisbatman
Programmer
I need to know what governs the creation of mysql processes, and how I can limit them.
I've got a linux server running Mysql/Php to host a popular website... It averages about 150 requests per second. The hardware is a dual athlon MP with 1 gig of ram. Every so often say once every other day, the server mysql starts performing HORRIBLY.
When i look at "free" I've got plenty of ram free, and looking at TOP reveals that MYSQL is creating TONS and TONS of processes. This is a tell tale symptom that my server is undergoing this problem. I can get the server back under control by adding <? die("Server Busy" ?> to the top of our include file in PHP. Here is a snapshot of "top" during this problem.
479 processes: 398 sleeping, 81 running, 0 zombie, 0 stopped
CPU0 states: 97.5% user, 2.16% system, 0.0% nice, 0.0% idle
CPU1 states: 99.9% user, 0.11% system, 0.0% nice, 0.1% idle
Mem: 772056K av, 688804K used, 83252K free, 0K shrd, 12180K buff
Swap: 0K av, 0K used, 0K free 257784K cached
PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME COMMAND
30962 mysql 14 0 49748 48M 1516 R 13.6 6.4 0:02 mysqld
31029 mysql 18 0 49776 48M 1516 S 2.5 6.4 0:03 mysqld
31053 mysql 19 0 49776 48M 1516 S 2.5 6.4 0:03 mysqld
30938 mysql 14 0 49748 48M 1516 R 2.4 6.4 0:04 mysqld
31019 mysql 15 0 49776 48M 1516 R 2.4 6.4 0:03 mysqld
30995 mysql 20 0 49748 48M 1516 R 2.3 6.4 0:02 mysqld
31017 mysql 14 0 49776 48M 1516 R 2.3 6.4 0:03 mysqld
31103 mysql 20 0 49804 48M 1516 R 2.2 6.4 0:02 mysqld
31185 mysql 20 0 49828 48M 1516 R 2.2 6.4 0:01 mysqld
31186 mysql 20 0 49828 48M 1516 R 2.2 6.4 0:01 mysqld
31244 mysql 20 0 49828 48M 1516 R 2.2 6.4 0:01 mysqld
30720 mysql 20 0 49720 48M 1516 R 2.1 6.4 0:07 mysqld
30768 mysql 20 0 49720 48M 1516 R 2.1 6.4 0:07 mysqld
30840 mysql 20 0 49720 48M 1516 R 2.1 6.4 0:05 mysqld
30901 mysql 14 0 49748 48M 1516 R 2.1 6.4 0:05 mysqld
30912 mysql 14 0 49748 48M 1516 R 2.1 6.4 0:04 mysqld
30975 mysql 15 0 49748 48M 1516 R 2.1 6.4 0:04 mysqld
31014 mysql 14 0 49776 48M 1516 R 2.1 6.4 0:03 mysqld
31243 mysql 20 0 49828 48M 1516 R 2.1 6.4 0:01 mysqld
31248 mysql 20 0 49828 48M 1516 R 2.1 6.4 0:01 mysqld
31257 mysql 14 0 49820 48M 1516 R 2.1 6.4 0:01 mysqld
31265 mysql 20 0 49820 48M 1516 R 2.1 6.4 0:00 mysqld
30080 mysql 20 0 49720 48M 1516 R 2.0 6.4 0:17 mysqld
30732 mysql 20 0 49720 48M 1516 R 2.0 6.4 0:07 mysqld
30846 mysql 20 0 49720 48M 1516 R 2.0 6.4 0:03 mysqld
30867 mysql 14 0 49748 48M 1516 R 2.0 6.4 0:03 mysqld
30900 mysql 14 0 49748 48M 1516 R 2.0 6.4 0:05 mysqld
30919 mysql 14 0 49748 48M 1516 R 2.0 6.4 0:04 mysqld
31262 mysql 20 0 49820 48M 1516 R 2.0 6.4 0:00 mysqld
31268 mysql 14 0 49820 48M 1516 R 2.0 6.4 0:00 mysqld
31272 mysql 20 0 49820 48M 1516 R 2.0 6.4 0:00 mysqld
30972 mysql 14 0 49748 48M 1516 R 1.9 6.4 0:04 mysqld
30980 mysql 14 0 49748 48M 1516 R 1.9 6.4 0:04 mysqld
31073 mysql 20 0 49776 48M 1516 R 1.9 6.4 0:02 mysqld
31105 mysql 14 0 49804 48M 1516 R 1.9 6.4 0:02 mysqld
31115 mysql 15 0 49804 48M 1516 S 1.9 6.4 0:02 mysqld
31214 mysql 14 0 49828 48M 1516 R 1.9 6.4 0:01 mysqld
31258 mysql 19 0 49820 48M 1516 R 1.9 6.4 0:01 mysqld
30104 mysql 15 0 49720 48M 1516 R 1.8 6.4 0:13 mysqld
30274 mysql 14 0 49720 48M 1516 R 1.8 6.4 0:13 mysqld
30463 mysql 14 0 49720 48M 1516 R 1.8 6.4 0:06 mysqld
30483 mysql 20 0 49720 48M 1516 R 1.8 6.4 0:10 mysqld
30725 mysql 14 0 49720 48M 1516 R 1.8 6.4 0:07 mysqld
30755 mysql 14 0 49720 48M 1516 R 1.8 6.4 0:07 mysqld
I've got a linux server running Mysql/Php to host a popular website... It averages about 150 requests per second. The hardware is a dual athlon MP with 1 gig of ram. Every so often say once every other day, the server mysql starts performing HORRIBLY.
When i look at "free" I've got plenty of ram free, and looking at TOP reveals that MYSQL is creating TONS and TONS of processes. This is a tell tale symptom that my server is undergoing this problem. I can get the server back under control by adding <? die("Server Busy" ?> to the top of our include file in PHP. Here is a snapshot of "top" during this problem.
479 processes: 398 sleeping, 81 running, 0 zombie, 0 stopped
CPU0 states: 97.5% user, 2.16% system, 0.0% nice, 0.0% idle
CPU1 states: 99.9% user, 0.11% system, 0.0% nice, 0.1% idle
Mem: 772056K av, 688804K used, 83252K free, 0K shrd, 12180K buff
Swap: 0K av, 0K used, 0K free 257784K cached
PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME COMMAND
30962 mysql 14 0 49748 48M 1516 R 13.6 6.4 0:02 mysqld
31029 mysql 18 0 49776 48M 1516 S 2.5 6.4 0:03 mysqld
31053 mysql 19 0 49776 48M 1516 S 2.5 6.4 0:03 mysqld
30938 mysql 14 0 49748 48M 1516 R 2.4 6.4 0:04 mysqld
31019 mysql 15 0 49776 48M 1516 R 2.4 6.4 0:03 mysqld
30995 mysql 20 0 49748 48M 1516 R 2.3 6.4 0:02 mysqld
31017 mysql 14 0 49776 48M 1516 R 2.3 6.4 0:03 mysqld
31103 mysql 20 0 49804 48M 1516 R 2.2 6.4 0:02 mysqld
31185 mysql 20 0 49828 48M 1516 R 2.2 6.4 0:01 mysqld
31186 mysql 20 0 49828 48M 1516 R 2.2 6.4 0:01 mysqld
31244 mysql 20 0 49828 48M 1516 R 2.2 6.4 0:01 mysqld
30720 mysql 20 0 49720 48M 1516 R 2.1 6.4 0:07 mysqld
30768 mysql 20 0 49720 48M 1516 R 2.1 6.4 0:07 mysqld
30840 mysql 20 0 49720 48M 1516 R 2.1 6.4 0:05 mysqld
30901 mysql 14 0 49748 48M 1516 R 2.1 6.4 0:05 mysqld
30912 mysql 14 0 49748 48M 1516 R 2.1 6.4 0:04 mysqld
30975 mysql 15 0 49748 48M 1516 R 2.1 6.4 0:04 mysqld
31014 mysql 14 0 49776 48M 1516 R 2.1 6.4 0:03 mysqld
31243 mysql 20 0 49828 48M 1516 R 2.1 6.4 0:01 mysqld
31248 mysql 20 0 49828 48M 1516 R 2.1 6.4 0:01 mysqld
31257 mysql 14 0 49820 48M 1516 R 2.1 6.4 0:01 mysqld
31265 mysql 20 0 49820 48M 1516 R 2.1 6.4 0:00 mysqld
30080 mysql 20 0 49720 48M 1516 R 2.0 6.4 0:17 mysqld
30732 mysql 20 0 49720 48M 1516 R 2.0 6.4 0:07 mysqld
30846 mysql 20 0 49720 48M 1516 R 2.0 6.4 0:03 mysqld
30867 mysql 14 0 49748 48M 1516 R 2.0 6.4 0:03 mysqld
30900 mysql 14 0 49748 48M 1516 R 2.0 6.4 0:05 mysqld
30919 mysql 14 0 49748 48M 1516 R 2.0 6.4 0:04 mysqld
31262 mysql 20 0 49820 48M 1516 R 2.0 6.4 0:00 mysqld
31268 mysql 14 0 49820 48M 1516 R 2.0 6.4 0:00 mysqld
31272 mysql 20 0 49820 48M 1516 R 2.0 6.4 0:00 mysqld
30972 mysql 14 0 49748 48M 1516 R 1.9 6.4 0:04 mysqld
30980 mysql 14 0 49748 48M 1516 R 1.9 6.4 0:04 mysqld
31073 mysql 20 0 49776 48M 1516 R 1.9 6.4 0:02 mysqld
31105 mysql 14 0 49804 48M 1516 R 1.9 6.4 0:02 mysqld
31115 mysql 15 0 49804 48M 1516 S 1.9 6.4 0:02 mysqld
31214 mysql 14 0 49828 48M 1516 R 1.9 6.4 0:01 mysqld
31258 mysql 19 0 49820 48M 1516 R 1.9 6.4 0:01 mysqld
30104 mysql 15 0 49720 48M 1516 R 1.8 6.4 0:13 mysqld
30274 mysql 14 0 49720 48M 1516 R 1.8 6.4 0:13 mysqld
30463 mysql 14 0 49720 48M 1516 R 1.8 6.4 0:06 mysqld
30483 mysql 20 0 49720 48M 1516 R 1.8 6.4 0:10 mysqld
30725 mysql 14 0 49720 48M 1516 R 1.8 6.4 0:07 mysqld
30755 mysql 14 0 49720 48M 1516 R 1.8 6.4 0:07 mysqld