I've had a known inefficiency in Perlbal for ages now and finally broke down and fixed it. The inefficiency is that sendfile can block, even if the destination fd is a non-blocking socket, because the source fd (a disk-based file), can force a disk read if it's not already in pagecache. FreeBSD has a fancy sendfile that lets you request it not block, but Linux doesn't. The solution on Linux is to
![brad's life - readahead / blocking sendfile](https://cdn-ak-scissors.b.st-hatena.com/image/square/74e90599656ceadb00e4e45cf296cc44473e9e7e/height=288;version=1;width=512/https%3A%2F%2Fl-stat.livejournal.net%2Fimg%2Fsign.png)