-1

I'm running a php website. I have two servers.

Please help me to check is this Mysql Database Server load too high? I found the mysql CPU usage is always higher than 100%. Any suggestions to optimize?

I'm using CentOS release 5.8 Mysql 5.1.63-cll MySQL Community Server

4 Processors Intel Xeon 2.13G Total Memory: 4 G

enter image description here

my.cnf

myisam_sort_buffer_size = 64M
thread_cache_size = 8
query_cache_size= 100M
thread_concurrency = 4
max_connections = 600
max_user_connections=600
Tester
  • 177
  • 1
  • 1
  • 7
  • 1
    since you have multiple processors, you can have over 100% utilization. if you google it, there are thousands of examples and explanations out there. optimizing depends on what you are doing. lots of reads? lots of writes? what type of data are you storing. are you noticing performance issues? long db queries? – au_stan Aug 20 '12 at 15:58

2 Answers2

2

The short answer: No, the load is not too high.

Some detail on that

You have 4 processors and as you can see there is no iowait (0.0%wa).

If you had iowait, it could show you that the storage you are using is too slow to serve data fast enough for the processors. But since there is no iowait, the storage isn't the one causing load.

Given that you have 4 processors, a load of 1.5 is nothing to worry about at all. In fact, you shouldn't start wondering about load issues until your load is constantly over 5.

A little something about load

Let's use a metaphor for CPU cores. Let's say that each core is a tube. The load average describes the amount of water that needs to go through the tube.

1 tube means that we can handle a load of 1 without any worrying. This means that if you have a lot of water, the load will increase because the tube is not big enough to let all the water through. (water being processes)

So, if you have 4 cores - you can easily handle a load of 4, before having to worry about adding more tubes :)

I hope it makes sense.

Edit: The obvious

If you are serving just 1 user doing very little, your code might be very bad and you should look into optimizing. But if you are having a fairly busy application running, I wouldn't start the red lights.

Frands Hansen
  • 4,657
  • 1
  • 17
  • 29
  • the _tubes_ reminded me of this blog update which may help with a visual - http://blog.scoutapp.com/articles/2009/07/31/understanding-load-averages – au_stan Aug 20 '12 at 15:59
1

yes? no? it depends?

if your server is processing batch job - possibly you utilize your resrouces to the maximum. if it's used as a backend for some interactive/web-app - it's not good.

random hints:

pQd
  • 29,981
  • 6
  • 66
  • 109
  • I'm running a php website. – Tester Aug 20 '12 at 15:37
  • @review your queries - possibly some of them dont use indices. maybe you use subqueries with that version of mysql cannot execute in an optimal way. – pQd Aug 20 '12 at 16:19