-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
slow image serving with (changed) static_files example #243
Comments
What's almost certainly happening here is that your browser is opening one connection per file and using keep-alive to keep the connection open even after an image has loaded. Once there are as many connections as there are workers, the server won't accept new connections until an existing connection closes. Because the keep-alive timeout is set to five seconds, you'll get a new connection in about that time, and thus, see a pause of ~5 seconds. Your machine probably has 8 logical cores. This issue is caused by the synchronous nature of the server. Once Rocket is fully asynchronous (#17), this won't happen. Until then, you have two options:
|
Thank you. With |
@SergioBenitez, how is the async conversion going? Is there anything that you need tested? |
#1065 is the async tracking issue. I think the checklist is a bit outdated; I can share an update in a day or two. As far as this specific bug report, I have not tested it individually but it should be resolved because the number of concurrent requests has increased from |
Per rwf2/Rocket#243, attempting to fix this by jacking up the number of workers. Once async is done, this shouldn't be needed.
I try to learn rocket and experience partially slow image (.jpg) serving in my test application.
I changed the static_files example to see if it is the same, there.
I added this to the html file:
and copied these thumbnail images into the static folder of the example. (300x200px jpg)
It takes about 5 seconds until I see all photos in the browser. The first 8 appear fast, and then it takes some seconds. ....also until I see the requests in the terminal:
I don't know what this could be. Perhaps someone can help.?
(it is cargo updated to 0.2.3 and I did a git pull in the rocket directory, to have it up to date)
The text was updated successfully, but these errors were encountered: