Last week I attended Linux Expo Milan, and in that occasion I had a chance
to meet
Andrea Arcangeli, Linux hacker of some fame.
He and I had a few chats about possible improvements for I/O tasks on Linux
systems, and there are a few pointers that might be of use.
Notice: I haven't had a chance to verify those, and some of them are
only documented in Andrea's posts to the Linux Kernel Mailing list,
googlization is thus advised.
1) O_DIRECT
It's an improvement about to enter Linux kernel 2.4 which is meant for
self-caching
applications (such as databases or Squid).
If an O_DIRECT flag is passed to open(2), then subsequent read() and write()
calls
do _NOT_ go to through the kernel caches, but straight to/from disk.
A limitation is that all write and reads must be block-aligned (pagesize is
a
conservative but working approximation).
There are no speed gains to be obtained, but memory savings and a 10x
decrease in
CPU overhead for IO bound tasks.
2) Non-blocking, zero-copy sendfile()
Here my memory is a bit cloudy. He suggests to use
TCP_CORK+sendfile()+TCP_UNCORK and
use EAGAIN for nonblockingness. It DMAs stuff from HDD to the socket, again
with
very little overhead. Must be used with a grain of salt, since it clangs
with content-encoding. Where it doesn't, it might be an useful addition.
3) sendto(MSG_MORE)
should be a packetized high-efficiency interface to TCP stuff out.
4) psetopt(?)
should be a way to do a per-process automatic TCP_CORK.
Comments?
-- /kinkieReceived on Mon Jun 11 2001 - 05:09:43 MDT
This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:14:03 MST