-
Notifications
You must be signed in to change notification settings - Fork 157
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
StaticFilesHandler freezing #308
Comments
This sounds related to keep-alive, as the default timeout is currently 75 seconds: Line 50 in dfcb3ba
What version of rustc are you compiling with? Do you have a public link to repro with? |
I'm working with @jolhoeft and we're using rustc 1.4.0 (8ab8581f6 2015-10-27), which I built. I don't think we have any public links right now. |
I've also build it with rustc 1.5.0 (3d7cd77e4 2015-12-04), and see the same issue. I see in the logs it appears we have only five threads handling connections (2016-01-03T19:27:38-08:00 DEBUG hyper::server - threads = 5). If all the threads were used, I could see connections blocking. Is there an easy way to increase the number of threads? |
Further investigation revealed it was a thread exhaustion issue as discussed in the docs for Nickel::keep_alive_timeout, and hyperium/hyper#368. Disabling keep-alives has resolved the issue while we are doing small scale testing, but I am concerned about the performance impact when we scale to higher volumes. |
Thanks for investigating! Yeah I think raising the threadpool amount, or lowering the keep-alive should be the fix here. Perhaps the nginx default of 75 seconds is unreasonably high for us as we don't currently have async i/o, did a lower value help you at all with this?
I don't think we've actually exposed this, but I'd be happy to review a PR to add it, or I'll look to add it soon if you don't have the time! |
I didn't try a lower values, just disabling them completely. Our application drives an XMLHttpRequest every second or so, so a lower keep alive wouldn't be very helpful. We will be migrating to websockets for that part though. I'll try to create a PR in the next couple days. We don't have an immediate need for this, but in general being able to tune thread counts along with keep alives seems necessary. |
PR #309 submitted |
We've released 0.8.1 with a change based on the PR mentioned above, so I'm going to close this now. Please feel free to reopen if you continue to have issues. |
I have the lastest version of rust and nickel - and situation is the same. All my app - is just static content from directory: ~4 files is ok, and 5th is hang for ~15secs. |
I have a small webpage/app that is freezing on loading some static content. There are two css and four js files being loaded. The freeze does not always occur, but when it does, it is usually in the last file listed in the header of the webpage. I am not seeing any freezing with the dynamic content of my web app, just loading the preliminary static files.
The frozen download sometimes times out, or loads after a minute or more (75 seconds on my most recent repro). I've turned the log level to debug, and don't see any messages from nickel or hyper about the download for the first 75 seconds, then it seems to complete in the expected time (a few milliseconds).
I can regularly reproduce this with Firefox, and have reports of it on Chrome, too.
The text was updated successfully, but these errors were encountered: