Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Zero-copy file serving #143
After browsing through the source: fileserver.d -> server.d -> core/net.d -> drivers/libev.d -> stream.d
I noticed files are written using writeDefault() which always buffers in 64K. That's soo 1990's ;-)
When gzip isn't required (for example when data is already gzipped on disk) the OS kernel should just do the network transfer.
Left to do:
referenced this issue
Jul 26, 2013
added a commit
Jul 26, 2013
Sorry, I don't remember exactly, but I think that I didn't even get a single file to be delivered using that code. On Windows it simply crashed and on Linux I'm not sure, but it didn't work either. If it does work now, maybe something has changed in the latest libevent version?
I can try again on Windows in the coming days but won't have a Linux box available for the next two weeks.
No problem. It looks like the code works here. I'm running libevent 2.0.21 on Debian. I tested with httperf and ab. Both give errors when I execute more than 1500 requests per seconds. But this happens independent of zero copying. I.e. it is unrelated. But is this to be expected? At 1000 requests I get no errors and some speed up.