Strony

środa, 18 czerwca 2008

sync mount flag # UPDATED

I have an usb disk, quite quick, because it is WD MyBook... I mounted it with sync flag, because I want to have every data synced in case of power down or sth, but it was extremally slow!
# dd if=/root/plik of=/mnt/usb-disk/test.plik
1503+0 records in
1503+0 records out
769536 bytes (770 kB) copied, 20.2588 s, 38.0 kB/s

without sync flag:
# dd if=/root/plik of=/mnt/usb-disk/test.plik
3420160+0 records in
3420160+0 records out
1751121920 bytes (1.8 GB) copied, 59.4326 s, 29.5 MB/s

so i added a sync to the end of my backup script and it is really faster!

--- UPDATE :) ---


OK... because I was not exact in my tests... and it was quite unprofessional...

two test files (to be sure that nothing has been cached in ram):
# dd if=/dev/urandom of=/root/file.test bs=1M count=200
200+0 records in
200+0 records out
209715200 bytes (210 MB) copied, 61.2699 s, 3.4 MB/s

# dd if=/dev/urandom of=/root/file2.test bs=1M count=200
200+0 records in
200+0 records out
209715200 bytes (210 MB) copied, 61.3002 s, 3.4 MB/s

one drive:
Vendor: WD Model: 7500AAC External

formated with ext3 FS,

TEST 1:
/dev/sde1 on /mnt/usb-disk type ext3 (rw)

mounted without sync flag... so the test will be:
# time dd if=/root/file.test of=/mnt/usb-disk/file1; sync
409600+0 records in
409600+0 records out
209715200 bytes (210 MB) copied, 4.13321 s, 50.7 MB/s

real 0m8.887s
user 0m0.184s
sys 0m3.536s

TEST 2:
/dev/sde1 on /mnt/usb-disk type ext3 (rw,sync)

now the test with sync flag
I know that it is quite not full... but I give up after 18 minutes...
# time dd if=/root/file2.test of=/mnt/usb-disk/file2
94360+0 records in
94360+0 records out
48312320 bytes (48 MB) copied, 1127.69 s, 42.8 kB/s

real 18m48.073s
user 0m0.000s
sys 0m0.192s

0 komentarze: