LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Load average too high (https://www.linuxquestions.org/questions/linux-newbie-8/load-average-too-high-896649/)

chobong 08-10-2011 09:52 PM

Load average too high
 
Dear All,

I wrote a script to extract and get the the name of *.gz in a foler . Since running that script every 10 minutes, load average on my server increases more than 10. :(
I checked with 'top' and it showed many D process ...

Quote:

[myserver]# top
...
15121 root 16 0 0 0 0 D 0.0 0.0 0:00.00 basename
8049 root 16 0 0 0 0 D 0.0 0.0 0:00.00 basename
28875 root 25 0 0 0 0 D 0.0 0.0 0:00.00 basename
29008 root 16 0 0 0 0 D 0.0 0.0 0:00.00 basename
19404 root 25 0 0 0 0 D 0.0 0.0 0:00.00 basename
...
Here is my script
Quote:

#!/bin/sh
cd /myfolder
for f in *.gz; do
file=$(basename "$f" .gz)
gunzip -c "${f}" > /home/tmp/$file
done
And my folder has a lot of *.gz file. (about 400 files)
Could you please help me to check my script?
Thanks a lot!

Nick_Minter 08-11-2011 12:58 AM

Hi Chobong,

I've looked at the script and it should be functioning as should be expected.

Can you provide some further information:

* Size of files in question
* Length of filenames
* number of files that are being processed

Regards,
Nick.

chobong 08-11-2011 01:38 AM

Thanks for your reply, Nick

-Size of files: less than 1 MB for each file (4M for all files)
-Length of filenames: this is log files of amazon-ec2, files have the same format like this
xxxxxxxxxxxxxx.2011-08-01-08.qVcTdHH1.gz
- Number of files: about 370 files and it will be increased when script run..

Do you have any idea for this problem?


All times are GMT -5. The time now is 05:40 AM.