[PATCH] fadvise(2) system call

Lev Serebryakov lev at FreeBSD.org
Sun Oct 30 11:52:43 UTC 2011

Hello, Adrian.
You wrote 30 октября 2011 г., 15:44:43:

>>   I don't know. But I could show your results of typical ktrace, where
>>  transmission-daemon spends 590 seconds of 600 (Wall time) in
>>  pread() syscall , and real read speed is only about 30Mbit/s (and
>>  this FS could be read at speed about 300MiB/s, 100 times faster,
>>  with linear read).
> Is the app doing multi-threaded disk IO? How random is the IO?
  No, it is single-threaded, but I/O is very random one. This single
thread serves many (up to 128 in my setup, and this limit often
reached) clients. Typical "logical" block for client is about 1-2MiB,
and many clients download several consequent logical blocks. But basic
I/O size in transmission is only 32Kb.

> How is fadvise being used in the torrent client? Is it being used to
> force in data into cache?
  Yep. With fadvice() transmission notify kernel about logical block
(1-2MiB, depends on torrent itself) as "will need" and read from it
when client ready to receive next 32KiB portion. Without fadvice() it
looks like completely random I/O with 32KiB blocks (with total size of
files about 1TiB in my case!).

  I have very large vfs.read_max, but it doesn't help much :(

// Black Lion AKA Lev Serebryakov <lev at FreeBSD.org>

More information about the freebsd-arch mailing list