MySQL Forums
Forum List  »  Performance

[Solved] CPU usage too low
Posted by: A R
Date: September 02, 2012 04:52PM

I've searched quite a bit on the web to no success, and the answers that more or less touched on my issue were too technical. I'm really unsure whether to post here or in the Newbie forum, please let me know if I should.


My CPU is running very low (at about 15%) when running the following bash script:

#!/bin/bash
cd /to/relevant/dir
for i in Table*;
dbf2mysql -n -d Census -t $(echo $(basename "$i" ".dbf")) -c -P <pssw> -U root $i;
done;


I'm batch converting .dbf files into sql tables in the database Census using dbf2mysql.

My problem is the following: I used this same method on my previous laptop and it took it about 5 minutes to perform 32 conversions (about 3.5 Gb of data in total). Upon inspecting the CPU usage during the performance I saw it was usually around 100%.

Using the exact same scripts on a different laptop I get the above problem, i.e. my CPU being stuck at ~15%, and the process that took some minutes now takes at least 10 hrs.

Both laptops have processors of similar speeds, are running Debian (although the previous laptop runs Squeeze and the current slower one runs Testing), both laptops have the exact same /etc/mysql/my.cnf files, same bash script, same nice settings, same pid cpulimits, and both used the same dbf2mysql operation within the bash script.

There are three things different. First, the faster laptop has Linux kernel 2.6.32-5amd64 and the slower one has Linux kernel 3.2.0-3-amd64. Second, the previous laptop's processing speed was slightly faster. Third, the laptop using 100% of CPU had 8 processors while the one using 15% only has 4. But I don't see why this would affect the % of CPU used --it would of course affect the total time of the operation, but not the _relative_ usage of the CPU if I understand correctly, specially because all the CPU usage was done in only a single processor in both instances. I therefore don't think it is a hardware issue, certainly not enough to justify such a massive difference in time or to explain to me the percentage of CPU used.

One thing I did different was the location of datadir (/var/lib/mysql for the fast case, /home/var_mysql for the slow case). Permissions in both folders are the same for user, and both are usable by mysql:mysql.

Could it be the location of datadir? I'm pretty lost here. What am I missing? Please advice.

Cheers,


--Edit: The final .MYD files are about triple size in the new, slower laptop, which makes me someting might be looping out of control?



Edited 2 time(s). Last edit at 09/25/2012 05:37PM by A R.

Options: ReplyQuote


Subject
Views
Written By
Posted
[Solved] CPU usage too low
13153
A R
September 02, 2012 04:52PM
4616
September 03, 2012 01:33PM
3280
A R
September 05, 2012 12:22AM
2851
September 05, 2012 03:35AM
2813
September 05, 2012 08:12AM
2506
A R
September 25, 2012 05:20PM
3212
A R
September 25, 2012 05:35PM
2820
October 01, 2012 11:49PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.