Why are disk writes so slow?



I am reading Richard Stevens' "Advanced Programming in the UNIX
Environment," a most excellent book.

Out of curiosity, I tried his I/O efficiency program on my IBM
A30 Thinkpad, running 6.0-RELEASE with default tuning parameters.
The test program reads file on stdin and writes to stdout, and
you modify bufsize to watch how time changes.

As in his example (with a bufsize of 8192),

time ./a.out < 1.5M-testfile > /dev/null

runs five times faster than (clock time)

time ./a.out < 1.5M-testfile > /a.out.out

Can someone explain to me why writing is five times as slow as
writing? What's going on in the computer?

The file is not O_SYNC, so it can't be validating the data on the
disk.

Later in the same chapter, he shows the impact of O_SYNC flag. I
re-ran this experiment too, and while everything is two orders of
magnitude faster than his times in the book, the relative speed
of writing with O_SYNC is three times slower.

1993 2006
----- ----
normal write 2.3s .023s
O_SYNC 13.4s .364s
slowdow factor 5.8 15.8

Is this all b/c disks are so much larger?

m
_______________________________________________
freebsd-performance@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-performance
To unsubscribe, send any mail to "freebsd-performance-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Re: XFS filesystem performance drop in kernels 2.6.16+
    ... Igor A. Valcov wrote: ... For one of our projects we have a test program that measures file ... system performance by writing up to 1000 files simultaneously. ... particular project specifically because it was about 5 times faster ...
    (Linux-Kernel)
  • Re: Best way to deal with long loops?
    ... Writing these out from scratch. ... Theirs is 10 times faster than the stock TTreeView, ... > TNodeSettings = PACKED record ... That may account for much or all of the difference apart from my writing ...
    (alt.comp.lang.borland-delphi)
  • Re: Propertie of Different Universe
    ... I'm writing some scifi stories, and I need to know the properties of a ... parallel universe where light speed is a billion times faster and ...
    (sci.physics)
  • Re: Performance of the 2003 SE emulator
    ... Someone has tested the app I am writing ... on a PDA with a 200 MHz Samsung and it was about 2 times faster than on ...
    (microsoft.public.pocketpc.developer)
  • Propertie of Different Universe
    ... I'm writing some scifi stories, and I need to know the properties of a ... parallel universe where light speed is a billion times faster and ...
    (sci.physics)