Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
09-12-2011, 01:17 PM
|
#1
|
LQ Newbie
Registered: Sep 2011
Location: London
Posts: 2
Rep: 
|
High CPU load, but low CPU usage (high idle CPU)
All,
I'm relatively new to Linux. I moved from a DBA role to a role where I now combine DBA duties with Linux admin work and therefore will need help with the following Linux question:
I'm in a situation where my developers run a particular SQL about 200 millions times a day (very unnecessary), this SQL is run between 10pm and 2 am everyday. At the time when this SQL is being run, load average is very high and everything becomes slower on the database. I'm trying to get the developers to tune this process but they say it's going to take too much effort, but most importantly, they keep pointing to 'idle time' on the CPU which could be as high as 72% (idle) even when the load is 50 (on a sixteen CPU box).
My question: Since the DB becomes much slower when the load average is high, how do I explain that the 72% idle time is a little misleading and the load average is very important in this instance (rem that all other quesries/SQL run slowly during the period explained above)
|
|
|
Click here to see the post LQ members have rated as the most helpful post in this thread.
|
09-12-2011, 01:40 PM
|
#2
|
Senior Member
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187
|
Have you looked at the I/O usage whilst the SQL task is running? Perhaps you could tune your system to use more "idle" RAM to cache the tables being accessed, or use a larger RAID array for the data base so the access could be distributed over many different disk drives. Have you considered high efficiency disk drive replacements? (e.g., RAM disks, bubble memory drives, etc.)
Have you asked the developers why they're running 200,000,000 queries a day in a production data base instead of a development copy of the data base? It seems like a very strange organizational structure that mixes development and production. (And where's QA in the mix? QA should, at a minimum, have tested any development work before it impacts a production system.)
|
|
3 members found this post helpful.
|
09-12-2011, 06:28 PM
|
#3
|
LQ Guru
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,430
|
As with above (and your statement) 200M sounds definitely wrong. I'd also be surprised if its that difficult to fix; sounds more like laziness to me (& I've worked with RDBMSes for many yrs).
In any case, the DB is likely IO bound as mentioned above. check the process statuses.
You can use top to get page fault cnts http://linux.die.net/man/1/top or use iostat http://linux.die.net/man/1/iostat for more IO specific details.
Given the scenario described, I'd also have a look at the SQL code; they may not be using the correct indexes or there may not be an index that matches their needs.
How much RAM do you have; a large SGA may help to cache the data the they keep asking for.
If its a lot of large queries over many new rows, a re-write sounds good as you won't be able to take advantage of caching.
|
|
3 members found this post helpful.
|
09-12-2011, 06:47 PM
|
#4
|
LQ Veteran
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,361
|
In Linux (high) loadavg has usually nothing to do with CPU%. (Almost) all the articles you see merely carry forward an old Unix mantra about loadavg. Linux defines it differently.
Has to be I/O waits - caused most probably by poor application design, but I'll leave that to the guys above as I don't "do" databases.
Run the following to determine what is probably contributing to the loadavg count - your mate might recognise the tasks listed. Post the output file here if you like.
Code:
top -b -n 1 | awk '{if (NR <=7) print; else if ($8 == "D") {print; count++} } END {print "Total status D (I/O wait probably): "count}' > topsave.txt
|
|
2 members found this post helpful.
|
09-13-2011, 11:41 AM
|
#5
|
LQ Newbie
Registered: Sep 2011
Location: London
Posts: 2
Original Poster
Rep: 
|
All,
Fantastic replies. Thanks to you all. Load averages vs CPU usage is now clearer to me. (I'll run the top script during the period this SQL is being run and see what comes up. Note that these SQLs are not as a result of developers testing scripts, but these have been put into production and come in via the app severs). Thanks all.
|
|
|
03-13-2013, 09:24 AM
|
#6
|
Member
Registered: Jun 2012
Posts: 122
Rep: 
|
Hi,
First of all sorry for high jacking the thread.
I read the post of syg00 .In below post .I gone through few article all the things says increase of loadavg leads to high cpu utilization.
But above post of sygoo really suprise me .Sygoo can u share your knowledge, how could load does not reflect cpu utilization.
@syg00 .In Linux (high) loadavg has usually nothing to do with CPU%. (Almost) all the articles you see merely carry forward an old Unix mantra about loadavg. Linux defines it differently.
Last edited by LittleMaster; 03-13-2013 at 09:28 AM.
|
|
|
All times are GMT -5. The time now is 08:59 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|