Re: poor sata performance on 2.6

Konstantin Sobolev
2004-04-16T16:57:30Z

On Friday 16 April 2004 18:48, Denis Vlasenko wrote:
> > When you mount a filesystem, it changes the default block size (512 or
> > 1024) to the filesystem block size, normally 4096. This would certainly
> > increase the throughput.
>
> Yes, this works.
>
> But if one uses unpartitioned disk, why does (s)he need to
> do some blocksize tricks before hdparm starts to measure good performance?
> I think that in this case block layer can coalesce small read requests
> into large ones regardless of block size.
>
> Konstantin, does dd give you the same behaviour as hdparm?

Sorry, I already partitioned it and put lots of data there.
But situation is reproducible by removing all /dev/sda entries from fstab and rebooting. Here are results of my experiments with dd:

kos root # bash -c "sleep 10 && killall -3 dd &" && LANG=C time dd if=/dev/sda of=/dev/null ibs=512 obs=512
537152+0 records in
537152+0 records out
Command terminated by signal 3
0.23user 3.73system 0:10.07elapsed 39%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+121minor)pagefaults 0swaps

kos root # hdparm -t /dev/sda

/dev/sda:
Timing buffered disk reads: 84 MB in 3.07 seconds = 27.37 MB/sec
kos root # bash -c "sleep 10 && killall -3 dd &" && LANG=C time dd if=/dev/sda of=/dev/null ibs=4096 obs=4096
71691+0 records in
71691+0 records out
Command terminated by signal 3
0.07user 3.83system 0:10.08elapsed 38%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+122minor)pagefaults 0swaps

kos root # mount /dev/sda2 /wd
kos root # hdparm -t /dev/sda

/dev/sda:
Timing buffered disk reads: 84 MB in 3.07 seconds = 27.38 MB/sec

kos root # hdparm -t /dev/sda

/dev/sda:
Timing buffered disk reads: 206 MB in 3.02 seconds = 68.13 MB/sec

kos root # bash -c "sleep 10 && killall -3 dd &" && LANG=C time dd if=/dev/sda of=/dev/null ibs=512 obs=512
1402384+0 records in
1402384+0 records out
Command terminated by signal 3
0.54user 2.57system 0:10.02elapsed 31%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+121minor)pagefaults 0swaps

kos root # bash -c "sleep 10 && killall -3 dd &" && LANG=C time dd if=/dev/sda of=/dev/null ibs=4096 obs=4096
329705+0 records in
329705+0 records out
Command terminated by signal 3
0.32user 2.43system 0:10.13elapsed 27%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+122minor)pagefaults 0swaps

It looks like dd behaves similarly to hdparm

--
/KoS
* yas eh d'tahW. ю\b\x04юmih raeh uoy diD