[Soekris] Harddisk Slow

Steven Finnegan sjf at ctrlsft.com
Wed Jan 31 14:02:59 UTC 2007


On Jan 31, 2007, at 3:21 , Igor Sobrado wrote:

> In message <1816282B-B315-4DE7-B13F-EFE507FB9CD2 at ctrlsft.com>,  
> Steven Finnegan writes:
>> Heinrich:
>>
>> When using DD, it is important that you set the buffer size.
>> Otherwise you end up transferring ONE sector at a time, which is very
>> inefficient.
>
> bs is the block size, not the buffer size.  It is, however, an useless
> parameter if the filesystem is not tuned to use that block size on all
> transactions by means of newfs.  A block size of 1024KB is probably
> not supported, and certainly not recommended for a general purpose
> filesystem (a fragment size of 128KB is certainly a waste of space
> for most filesystems, perhaps it will work for databases).  On a FFS,
> the default block size is 16KB.
>
> Cheers,
> Igor.


Well, you're right about the name of the parameter (block, not  
buffer). However it doesn't have anything to do with the filesystem's  
block size. DD will read an entire block (or partial block if it hits  
the EOF) before switching to write mode to write the block to the  
destination. By default, DD uses a block size of 512 bytes -- which  
is only a fraction of a standard filesystem block. This causes the OS  
to buffer both reads and writes.

Using a larger block size allows DD to do the buffering, allowing for  
longer reads and writes, and allowing for more efficient disk  
accesses. Hardly "useless".

I wasn't necessarily recommending 1MB as the most efficient value,  
but practically any value is better than the default! I CERTAINLY  
wasn't recommending setting a filesystem block size of 1MB!

DDing the suggested 100Mb file at different block sizes gives the  
following results on my system.

Block size	Thruput
512b		7.13MB/s
1k			11.63MB/s
2k			16.30MB/s
4k			21.0bMB/s
8k			10.34MB/s
16k			28.82MB/s
32k			29.30MB/s
64k			35.76MB/s
512k		37.77MB/s
1M			32.32MB/s
2M			28.20MB/s

 From this it would appear that the optimum DD blocksize for my  
system is somewhere between 512k and 1M


sjf


More information about the Soekris-tech mailing list