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
Extremely slow StaticFiles peformance #560
Comments
Hm... interesting, I don't think there should such serious change to StaticFiles. |
I enabled timeouts by default in latest versions of actix-web. that might affect default performance, but it should not be that dramatic |
After a bit of testing, it looks like ChunkedReadFile is what's slowing down StaticFiles so much. Also, something completely unrelated I noticed: Why is ChunkedReadFile public, but all of it's fields are private? Making it's fields public too would probably be a good idea. |
Just a note: there are no significant changes to the way we read static files. @kittyhacker101 So I'm curious do you see a similar problem with your regular handlers? |
Well, I haven't had any issues with normal streamed handlers, just with handlers using ChunkedReadFile (like StaticFiles). |
@fafhrd91 Do you remember were there any changes recently to the way actix-web sends out streaming/chunked bodies? I heard from another fellow that there was some problems with timing when responding with chunked responses |
@DoumanAsh It looks like commit c674ea9 is causing this problem. Performance before the commit:
Performance after the commit:
|
added nodelay in master, could you test again. |
When connecting to a HTTP server built with actix-web, if the server uses the builtin fs::StaticFiles method for serving content, there is a severe performance impact in newer versions of actix-web (> 0.7.8).
Here's a simple example server to show the issue:
(Note that the "index.html" file used for testing is 1024 bytes. When serving large files, the performance impact is much lower.)
Performance on actix-web v0.7.13:
Performance on actix-web v0.7.8:
The text was updated successfully, but these errors were encountered: