MySQL: Multi process or only one process

magic1000

Verified User
Joined
Mar 20, 2009
Messages
19
Location
Ha Noi - Viet Nam
Hello.
I setup 2 VPSs. Both use DirectAdmin

But I don't understand: Why a VPS is show multi mysqld process and a VPS is show only a mysqld process.
here:
Only a process:
Code:
10090 mysql     15   0  782m 186m 5924 S 15.0  4.6 681:49.59 mysqld
Multi process:
Code:
3905 mysql     15   0 35456  14m 3560 S  0.0  0.9   0:05.56 mysqld
 5736 mysql     18   0 35456  14m 3560 S  0.0  0.9   0:05.63 mysqld
13389 mysql     15   0 35456  14m 3560 S  0.0  0.9   0:05.61 mysqld
17996 mysql     16   0 35456  14m 3560 S  0.0  0.9   0:05.61 mysqld
26536 mysql     18   0 35456  14m 3560 S  0.0  0.9   0:01.31 mysqld
26537 mysql     15   0 35456  14m 3560 S  0.0  0.9   0:01.64 mysqld
26538 mysql     25   0 35456  14m 3560 S  0.0  0.9   0:00.00 mysqld
26540 mysql     16   0 35456  14m 3560 S  0.0  0.9   0:00.00 mysqld
26541 mysql     25   0 35456  14m 3560 S  0.0  0.9   0:00.00 mysqld
26542 mysql     18   0 35456  14m 3560 S  0.0  0.9   0:00.00 mysqld
26544 mysql     18   0 35456  14m 3560 S  0.0  0.9   0:00.26 mysqld
26545 mysql     18   0 35456  14m 3560 S  0.0  0.9   0:00.51 mysqld
26546 mysql     15   0 35456  14m 3560 S  0.0  0.9   0:00.00 mysqld
26547 mysql     15   0 35456  14m 3560 S  0.0  0.9   0:02.77 mysqld

Why config to mysql work with multi process? because I see multi process is faster only a process.
 
My first question would be, what kernel are u running on each server?

There is a feature of the linux kernel called NPTL. Which simply runs the process as one process, but multiple threads. This is the newer/optimal way of running mysql.

While running top, press H, to toggle if it shows threads or not.
Normal output for me:
3414 mysql 16 0 138m 38m 4524 S 0.3 1.9 65:19.99 mysqld

Output using H (Show threads on):
3504 mysql 16 0 138m 38m 4524 S 0.0 1.9 0:36.96 mysqld
3414 mysql 16 0 138m 38m 4524 S 0.0 1.9 0:13.58 mysqld
3503 mysql 16 0 138m 38m 4524 S 0.0 1.9 0:05.21 mysqld
3497 mysql 16 0 138m 38m 4524 S 0.0 1.9 0:01.92 mysqld
3500 mysql 16 0 138m 38m 4524 S 0.0 1.9 0:00.73 mysqld
3499 mysql 16 0 138m 38m 4524 S 0.0 1.9 0:00.72 mysqld
3495 mysql 16 0 138m 38m 4524 S 0.0 1.9 0:00.64 mysqld
3496 mysql 16 0 138m 38m 4524 S 0.0 1.9 0:00.24 mysqld
6602 mysql 16 0 138m 38m 4524 S 0.0 1.9 0:00.03 mysqld
3494 mysql 19 0 138m 38m 4524 S 0.0 1.9 0:00.00 mysqld

I found this blog post helpful: http://www.xaprb.com/blog/2006/07/16/how-we-enabled-threading-in-mysql/
 
Back
Top