-
Notifications
You must be signed in to change notification settings - Fork 284
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Zero-copy file serving #143
Comments
Left to do:
|
Add reading encoded file from disk if present. See #143.
I'm looking into the zero copy issue. |
If I remember well Linux had different symptoms, but ultimately it didn't work either (when I made that comment, I just tested on Windows). |
Then I just run httperf and see whether it reports any errors? I just need a starting point. |
It seems the errors are from httperf. I need to raise the number of open file descriptors. I'm looking into it. |
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. |
1500 requests per second or 1500 concurrent requests (i.e. "ab -c 1500 ...")? In the latter case, at least on Ubuntu getting errors would be normal, as the "ulimit" is somewhere at 1000 requests. I'll retry on Windows with 2.0.21. |
Sorry. I meant concurrent requests (
|
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.
Basically I'd like fileserver.d do something like this: http://wiki.nginx.org/HttpGzipStaticModule without userspace buffering.
The text was updated successfully, but these errors were encountered: