CPU utilization 50% on Dual Core Xeon and Windows [message #1894] |
Wed, 19 September 2007 03:56  |
milos.sakovic Messages: 2 Registered: September 2007 Location: Montenegro |
Junior Member |
|
|
I am running a MySQL 5.0 dedicated server on a Windows 2003 machine (Xeon 5130, 2GHz, two cores).
The problem is that MySQL process will utilize just 50%. Normally, I would presume that the MySQL thread uses just one core, but then, if you look at the graph more closely you can see that one core is used more then the other, and then they switch. Not like just one is utilized while the other stands by.
You can see the graph here:
[20kb]
I have read that it is a normal MySQL behavior: to utilize just one CPU (Core) per thread (Process?) and that is all fine because there is another point of my concern! While the query (which takes 50% of CPU resources) is running I cannot issue another query (even the simplest query) towards the server until the first one has finished...
Don't you think is very odd that my server cannot get the load past 50%?
I opened two browser windows on two different computers and request the data in the same time... It behaved the way I described before.
However, i connected to MySQL server using terminal on one machine and using web page on the other... After I requested some long-lasting query over the web page I could quite freely use terminal to request data using SQL and utilize more then 50% out of the CPU...
Does this make any sense? Could it be that PHP is locked to just one thread / process? How do I overcome this?
I tried running two different mysql console clients with same user and it utilizes 100%.
I still CANNOT make MySQL utilize more then one processor with PHP...
Say if one web user issues a long query all the other web users must wait for it to finish even to issue the simplest query!
At least point me in some direction.
Another thing... I have had that long query ran on my server while issuing two more simple requests and what I got is this picture (from MySQLAdmin's Server Connections TAB):
[3kb]
As you can see, the first query is running for 141 seconds and two more are SLEEPING even tho 50% of processor (one core) is unutilized.
I just can't figure it out...
Here goes my.cnf
[client]
port=3306
[mysql]
default-character-set=latin2
[mysqld]
skip-locking
port=3306
basedir="C:/mysql5/"
datadir="C:/mysql5/Data/"
ft_min_word_len=3
ft_stopword_file="c:/sphinx/stopwords.txt"
memlock
thread_concurrency = 4
thread_cache_size=16
default-character-set=latin2
default-storage-engine=MYISAM
sql-mode="NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
max_connections=30
key_buffer_size=50M
segment.key_buffer_size=950M
init_file="c:/mysql5/init.sql"
join_buffer_size=10M
read_buffer_size=128k
skip-innodb
|
|
|
|
| Re: CPU utilization 50% on Dual Core Xeon and Windows [message #1914 is a reply to message #1913 ] |
Thu, 20 September 2007 04:24  |
milos.sakovic Messages: 2 Registered: September 2007 Location: Montenegro |
Junior Member |
|
|
How can one SELECT query lock tables for other SELECT queries? o.O
I tried to optimize the query the best I can but the FULLTEXT is giving me hard time. I am using sphinx for some of the queries but I cannot use it for all since there are no wildcards in it and I badly need it.
Anyways... If you read my post carefully you can see that the "LOCKING" or "SLEEPING" or WHATEVER is happening when I issue queries from (say) web app. If I issue one on web app and one in console the "WHATEVER" does not occur.
|
|
|