[NTLUG:Discuss] OT: tapes and buffers

Steve Baker steve at sjbaker.org
Mon Sep 8 16:32:54 CDT 2008


If it's like burning a CD (and it amost certainly is), so long as the 
buffer never gets completely empty, you're OK.  That's why there IS a 
buffer - the idea is that you fill it up from the hard drive - then 
start writing to the tape/CD - so long as the hard drive runs faster 
than the output device, the buffer stays full - but if you (say) get an 
incoming email and it writes to disk - then there is a brief moment when 
the hard drive is busy.  During that time, the buffer will start to 
empty.  As soon as the hard drive is free again, it'll carry start to 
refill the buffer and (hopefully) catch up and refill it.

But if there is an insane amount of traffic on your machine, the hard 
drive may be off doing something else for so long that the buffer 
eventually drains completely empty and the tape/CD drive has to stop 
writing.  In the case of a tape, it then has to slow down and stop - 
which means it can't immediately start writing again from where it left 
off.  Instead, it has to rewind far enough back - to BEFORE where the 
last data was written - then (when there is again, enough data in the 
buffer) switch into "PLAY" mode - listen to the data coming off the tape 
and when the last block is read - drop into "RECORD" mode and carry on 
writing from the exact correct point.   This is HORRIBLY slow - but at 
least gives the hard drive a chance to catch up and (hopefully) refill 
the buffer.

If this back-and-forth "shining" is going on a lot - then it means that 
your hard drive is running excruciatingly slowly...either because it's 
busy doing some other job - or because there is a bad spot on the disk 
and it's having to do a bunch of retries.

If your machine is generally idle when you are doing this - then this 
probably suggests your hard drive is dying.

With CD burning, most drives are OK with the buffer running completely 
empty - but older drives would simply screw up and burn a bunch of crap 
onto the disk - which meant throwing the disk out and starting again.   
This meant that you might have to take the machine down into single-user 
mode and unplug the network in order to reliably write a disk on a 
heavily loaded machine.

The mental image you need here is of a bath (which is the buffer) - the 
drain hole is your tape drive and the faucet is the hard drive.  You 
plug up the drain hole and fill the bath - then when it's utterly full - 
you unplug the drain (start the tape drive) and with the faucet still 
pouring water in at the top (hard drive still stuffing data into the 
buffer) - let it start draining out of the bottom.  So long as the 
faucet produces more water than the drain can take out - the bath 
(buffer) stays full.  If someone flushes the toilet while you're doing 
this strange thing - the faucet will temporarily slow down and the bath 
may start to drain lower.  If you repeatedly flush every toilet in your 
house - maybe the bath will even eventually empty.  But if the faucet is 
producing only a dribble of water because it's blocked up somehow - then 
the bath will empty no matter what.

  -- Steve.


Fred James wrote:
> All
> This came up in a discussion of backups and tapes ...
>     I was told that a tape has a minimum write speed, below which it 
> "shoe shines" - that is when the buffer runs out the tape stops, 
> reverses and repositions while waiting for the buffer to have something 
> to write again.
>     I was told that multi-threading (multi-buffering?) was the/an answer 
> - a way to always have a buffer of data to write to the tape, and 
> therefore stop "shinning shoes"
> I have watched GUI displays of the tape writing process (or for burning 
> a CD, for that matter) during which the "buffer" indicator would 
> fluctuate from full to varying degrees of not so full, through out the 
> process.
> My question is how does the buffer work (or is that dependent on the 
> particular software?) - does it fill and then not accept new data until 
> it is empty again, or is it more like a pipe (input only limited by the 
> capacity of the buffer, and output anytime there is anything in the buffer)?
>
> Or am I asking the question wrong?
> Thank you in advance for any help you may be able to offer
> Regards
> Fred James
>
>
> _______________________________________________
> http://www.ntlug.org/mailman/listinfo/discuss
>   




More information about the Discuss mailing list