Re: pitiful performance of an SATA150 drive




On Wed, 1 Mar 2006, Rink Springer wrote:

I believe that linux uses bufferring in their 'raw' disks so that you
may be actually doing larger
reads and writes than you know.. (of course my knowledge of Linux is a
bit old so
they may have changed that)

Linux 2.5+ will always queue I/O requests in PAGE_SIZE chunks (4KB on i386) or less. These tiny requests will be concatinated by the disk elevator if possible; for example, reading 64KB from block 0 once would result in requesting 16 times 4KB, which will be translated to a single "Read 64KB from block 0" request.

Therefore, the PAGE_SIZE cache (also known as the buffer cache, which was merged with the page cache in the 2.5 tree) does not hurt performance one bit.

I have no clue what FreeBSD does on this end.

On FreeBSD, the disk device nodes provide unbuffered disk access, under the assumption that consumers will be providing their own caching, or they wouldn't be using the direct disk interface. Otherwise, applications like databases or userland file systems get double caching, which is a waste of memory. Likewise, you won't be able to do sub-block reads or writes using the FreeBSD disk I/O interfaces. In Linux, they probably still maintain the character vs. block distinction, in which case one may well offer significant caching, which will show up on micro-benchmarks that issue small I/O sizes or behave relatively unintelligently. In FreeBSD, you'll want to issue dd reads and writes of disks in large block sizes, such as 1mb, and they'll get broken down into smaller sizes by the I/O layers. I'm not sure what our maximum I/O size is, but I suspect it gets broken down into relatively small chunks on the way -- but better to use the largest you can, as the maximum I/O size will presumably increase over time.

Robert N M Watson
_______________________________________________
freebsd-current@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Re: Freebsd vs. linux
    ... The main reason why I consider Linux inferior to FreeBSD is that Linux ... Linus Torvalds originally wrote only the kernel portion of an operating ... I learned only yesterday that Linux does asynchronous disk ...
    (freebsd-questions)
  • Re: aio_read/write versus O_NONBLOCK
    ... |>|>It has not had any effect on ordinary file streams in Linux in the programs ... The disk is always there, so a read must always complete ... | a blocking read can be unbounded (serial ports, parallel ports, network ... In any case, what you want is asychronous I/O, rather than non-blocking I/O. ...
    (comp.unix.programmer)
  • Re: Configuration of Grub?
    ... disk is not existing (don't remember the exact ... If I understood right the hdd in Linux translates to ad3 in FreeBSD? ... with the 'hdx' format that Grub uses. ...
    (freebsd-questions)
  • Re: aio_read/write versus O_NONBLOCK
    ... The disk is always there, so a read must always complete ... | I don't think you really understand how file-based I/O works in linux. ... Why do you not think I really understand how file-based I/O works in Linux? ...
    (comp.unix.programmer)
  • Re: i have linux mandrake
    ... Lets say you have a large enough disk to make you happy - holds ... few GBytes left over to use for FreeBSD. ... If that Linux stuff is ... First you will need something to shrink the Linux slice split up ...
    (freebsd-questions)