Yes,I tested from two mysql clients with your code and it showed exactly as you pointed out. The top from the mysqld machine showed:
Cpu0 : 100.0% us, 0.0% sy, 0.0% ni, 0.0% id, 0.0% wa, 0.0% hi, 0.0% si Cpu1 : 0.3% us, 0.0% sy, 0.0% ni, 99.7% id, 0.0% wa, 0.0% hi, 0.0% si Cpu2 : 0.0% us, 0.3% sy, 0.0% ni, 99.7% id, 0.0% wa, 0.0% hi, 0.0% si Cpu3 : 100.0% us, 0.0% sy, 0.0% ni, 0.0% id, 0.0% wa, 0.0% hi, 0.0% si Mem: 2074824k total, 977252k used, 1097572k free, 74844k buffers Swap: 2031608k total, 0k used, 2031608k free, 720236k cached 24022 mysql 25 0 100 1:59.25 2.7 554m 55m 2448 R mysqld 24027 mysql 25 0 100 2:12.25 2.7 554m 55m 2448 R mysqld Thank you again. Yours, Xu Feng > -----Original Message----- > From: Dan Nelson [mailto:dnel...@allantgroup.com] > Sent: 2008年12月16日 13:51 > To: xufeng > Cc: mysql@lists.mysql.com > Subject: Re: MySQL 5.0.67 on SMP > > In the last episode (Dec 16), xufeng said: > > Is there a way to check if my MySQL5.0.67 works well on SMP? > > I have two CPUs with each two cores, and I want to know if MySQL distributes > > loads over the two CPUs. > > System OS: Linux 2.6.9-42.ELsmp > > MySQL Version: 5.0.67 > > Intel(R) Xeon(TM) CPU 3.00GHz * 2 > > The easiest way to check would be to run top, then run a long-running > CPU-hungry query like > > SELECT BENCHMARK(100000000,ENCODE('hello','goodbye')); > > from two separate mysql client sessions. You should see two CPUs worth > of load on the system at that point. > > In fact, any version of mysql should scale to multiple CPUs as long as > your OS supports kernel-based threads (most do). Note that a single > query will always only use one CPU, so you need multiple queries in > parallel to use more. > > -- > Dan Nelson > dnel...@allantgroup.com > > -- > MySQL General Mailing List > For list archives: http://lists.mysql.com/mysql > To unsubscribe: http://lists.mysql.com/mysql?unsub=xuf...@yuanjie.net -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/mysql?unsub=arch...@jab.org