Jump to content

WGET makes CPU very busy (I/O wait)


mrm

Recommended Posts

Hello to all :)
 
I am using Debian Jessie 5.25 on OPi PC+. And using rpi-monitor for monitoring stuff. I already made a fully working webserver and moved my wordpress to it, CPU usage around 10-20% when taking traffic, so it works like a charm. 
 
Today i decided i will use it to download a few big files with wget command. At first i was trying to be smart and save it directly to an ntfs pendrive mounted at usb0. Result - 40% I/O wait CPU usage and limited transfer (maybe 20-30 KB/s). Yes, my pendrive is bad, but hey, not so much.

 

So i cancelled wget and tried to download the same file into /var/ into my SD card (used as system disk). Well, transfer was ok (200kB/s server limit), but i still had around 25-30% I/O wait CPU usage. CPU total is around 40% but it doesn't do much because its pretty cold, i think it just waists a lot of time to save file into SD (my SD is not top shelf but its pretty decent, its 32GB class 10).
 
Simultaneously with this massive (200kB/s) wget download i tried other things:
Tried to move (mv) 1GB file from system SD to usb0 pendrive, it transferred only 10MB in 2 minutes.
Tried to move (WinSCP) 1GB file from system SD to usb0 pendrive, it timed out very quickly and threw connection error or something.
Tried to download (WinSCP) 1GB file from system SD to my PC, it started at 4MB/s and dropped to maybe 500b/s after a minute (yes, bytes!).

My average WinSCP - PC transfer is around 8MB/s in both directions... when wget is not downloading anything.

 

And i even stopped apache service to make sure it wont interfere with SD access (sql and stuff) - user CPU usage dropped to 0% but I/O wait is still at 25%.
 
My question is - is it normal? Is CPU so much busy while copying stuff? I don't thinks so, i was moving stuff between disks before and transfers was very decent. Or is it wget problem, maybe it tries to save data with very small chunks very often so storages can't keep up? I noticed it doesn't matter how fast download is, I/O wait is pretty the same for 500KB/s and 5MB/s.
 
Yes i know i have eMMC which is much faster, but i don't want to move my system to it, not right now. Unless i can mount it as a normal storage and run wget again?
 

Best,

mrm noob

 

/edit

 

So i was wrong. Its not the wget problem, its accessing usb pendrive problem. Wget is still running, but I/O wait suddenly dropped to 0%. I checked and i have one "test" file missing from /var/ and it can't be found nowhere - file i was moving to usb0 but cancelled it by ctrl+c, but it seems that mv command was still working in the background moving my file, and at the end it deleted it from both places?

 

I set another file to move from SD to usb0 with mv, it moves very slow, maybe 100-150KB/s and... uses 25% of I/O wait. Why? NTFS format or what? Tomorrow i will try with different pendrives.

Link to comment
Share on other sites

Better search the forum (google search, see my sig below) for iozone calls to isolate storage performance testing from other stuff. You should look for both sequential and random IO performance (the latter being more important for normal use cases).

 

40% I/O wait CPU usage

 

%iowait is not 'CPU usage' but CPU waiting for storage. Unfortunately in Linux this will be added to average load also so in your case with horribly low performing storage you'll always see a high 'average load' too (compare with 'uptime' command)

Link to comment
Share on other sites

%iowait is not 'CPU usage' but CPU waiting for storage. Unfortunately in Linux this will be added to average load also so in your case with horribly low performing storage you'll always see a high 'average load' too (compare with 'uptime' command)

Ok, so tell me only one thing. Is it affecting overall CPU performance? I mean, if i get lest say 50% i/o wait, then i have only the other half of processing power available and things might get done slower? Or CPU is waiting in the "meantime" and i don't have to worry about it?

 

I am familiar with iozone. But i ran it again and i know whats the problem. It was FAT32 mounted with the sync option which kills performance with write transfers under 150KB/s, and iozone clearly confirms this. NTFS works great, it gives 18MB/s write on my crappy pendrive :)

 

I am still learning. Sorry for bothering :)

 

FAT32:

              kB  reclen    write  rewrite    read    reread   r.read  r.write
           10240       4       84      879     5343     5352     5330       45
           10240      16      123     2994    13798    13956    14164      100
           10240     512      144     4060    25636    25691    25663     1735
           10240    1024      143     4079    25807    26111    26026     2084
           10240    4096      145     3165    26528    26518    26474     4706

NTFS:

              kB  reclen    write  rewrite    read    reread   r.read  r.write
           10240       4     2090     2979     7826     7926     7903     2111
           10240      16     2741     4255    15375    15475    15429     4302
           10240     512    17749    17928    21361    21394    21592    18062
           10240    1024    17580    17502    22156    22145    22140    18026
           10240    4096    18335    18652    22544    22314    22537    18503
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines