Re: Why are disk writes so slow?



On Tue, Sep 26, 2006 at 01:03:00PM -0400, Bill Moran wrote:
In response to Mark Bucciarelli <mark@xxxxxxxxxxxxx>:

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

I'm rather confused as to exactly what your question is ...


Heh, I'm just trying to understand how my computer works. I was
surprised that writes were _so much_ slower than reads. I
figured somebody here knew.

First off, writes are slower than reads if the data you're
reading is already cached in RAM. Unless you have _very_
little RAM in your machine, then anything that takes .023s to
write is going to be able to fit entirely in the buffer cache,
thus repeated access doesn't require any real disk activity.

I could try running the test immediately after rebooting.

Although I have no idea if he did. I bet he didn't. And we both
used the same size file: 1.5M. I wonder how much RAM he had.

Secondly, as to why Stevens saw less of a slowdown with O_SYNC
than you did -- I doubt there's one easy answer. Discs are
manufactured differently now than they were in 93, and there's
even a huge difference between different brands and different
types (i.e. SCSI/SATA) in addition to the differences in
hardware connecting the disks, and the drivers for that
hardware. There are dozens of places where the difference
could be occurring. I would guess that the drive itself does
write caching, and this heavily optimizes async writes, but
can't improve the performance of sync writes any.

I see.

Yeah, if you look at normal write compared to read speed that did
improve between the two data points. So that supports your
conjecture.

So you think this data has no value?

1993 2006
----- ----
(1) /dev/null write 0.3s .005s <-- read speed
(2) normal write 2.3s .023s
(3) O_SYNC 13.4s .364s

(2) / (1) 7.6 4.6 1.5x faster

(3) / (2) 5.8 15.8 2.75x slower relative to ASYNC

(3) / (1) 44.6 72.8 1.5x slower relative to read


It does makes me wonder how this test runs on Linux, since I
think databases use O_SYNC. I guess I'd have to install Linux on
my laptop and run the same test to have any useful information.
And reboot between each test. And shut down network interface
and all daemons.

In any case, thanks for your reply.

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: Random Restarts - Please Help
    ... but it'll keep your machine from rebooting. ... Choosing recovery actions if Windows stops unexpectedly. ... I am now experiencing a double count of the RAM at ... first boot-up, and "Windows cannot start normally" black screens twice at ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: What now?
    ... The computer worked perfectly for the first couple of weeks, then it began rebooting spontaneously. ... I did replace the original 1 GB of RAM with 2 GB of RAM. ... The first thing I'd do, is disable "Automatic restart" in Windows, ... key is needed to enter the BIOS, then wait and see what happens). ...
    (alt.comp.hardware.pc-homebuilt)
  • Re: NTFS.sys bsod
    ... the machine goes into rebooting and never able to ... At least some of the new RAM is probably defective. ... >Everytime I tried to boot that machine with the sick HDD as 2nd master, ... inch diskette. ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: 386sx/25mhz compatibility
    ... > install linux on them in a home network. ... I'd need to add hard drives also, ... Max. out the RAM. ...
    (comp.os.linux.hardware)
  • Re: Install FC 2 with 16 MB Ram
    ... On Fri, 2004-07-23 at 14:44, Frederico Madeira wrote: ... > 16 Mb ram and i need to install linux to make them as servers. ...
    (Fedora)