Tell me more ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Given the following command:

gunzip -c /mnt/mysmbshare/mybackup.gz | dd of=/dev/sdb bs=1M

Why would the machine go through cycles of a really long phase of reading data from the network (with no disk activity), THEN writing all of that to disk (while not reading from the network drive), repeatedly?

Only 1.7GB of the 8GB of RAM is being consumed - I would have thought it could be smarter about streaming the data to disk.

In other words, the disk /dev/sdb is surely the bottleneck (/mnt/mysmbshare can saturate the gigabit ethernet easily) - so why does the command above leave it idle for ages while reading from the network into RAM?

In the case where actually the CPU is the bottleneck (dealing with gunzip), why is it left idle for ages in each cycle?

share|improve this question
How fast is the CPU? Can it be that data is read faster from the network than it is being decoded? (Read and decode - read and decode - local buffers full enough for gunzip - stop reading but keep decoding (no network reads!) ---- All the while dd is waiting for a chunk of 1MB of data to fill up) ? – Hennes Dec 12 '12 at 19:56

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.