Opened 6 years ago
Last modified 6 months ago
I've done a quick hack to this effect. It seems that sendfile(2)-enhanced twisted.web is significantly closer to Apache speeds on large (5MB) files. Benchmarks will be posted once somebody figures out how to properly measure the speed.
can you upload a patch, even if it's a nasty hack?
Where's the patch?
Yea where's the patch?
The branch is here: http://twistedmatrix.com/trac/browser/branches/pahan/sendfile/sandbox/pahan?rev=10492
The original sendfile wrapper is from here: http://snakefarm.org/.
For people interested, I've try to update PenguinOfDoom's work in sendfile-585, and it seems to work fine.
Not having looked at the patch yet, some test suggestions:
1) If the sendfile syscall is present, but fails, the code deals sanely (fallback to read/send, I suppose, or else some kind of notification?)
1b) what if it fails because the file is unreadable or has an I/O error of some kind?
2) SSL sockets don't support sendfile
3) it works, or at least, doesn't blow up on *BSD (which has a sendfile, with a different signature)
From a quick skim of the branch, a couple thoughts:
Replying to jknight:
Thanks.
For now, that closes the connection.
Same as above.
I'm interested to know what behavior we could choose.
Yes that's disabled, even thought I'm not really happy about the mecanism (value of the sendfile attribute)
I didn't do that yet, but it's interesting.
(In [22235]) Branching to 'sendfile-585-2'
(In [22239]) Docs and cleanups.
Refs #585
(In [23312]) Branching to 'sendfile-585-3'
This is cool. I am going to call it a core ticket, though, since it's about extending the reactor interface.
(In [28626]) Branching to 'sendfile-585-4'