Skip to content
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

Thread pool size issue #322

Closed
5nyper opened this issue Feb 17, 2015 · 4 comments
Closed

Thread pool size issue #322

5nyper opened this issue Feb 17, 2015 · 4 comments

Comments

@5nyper
Copy link

5nyper commented Feb 17, 2015

After some days of diagnosing my website because of latency issues, a friend from IRC (@jshs) and I started testing the website by having multiple open connections, and have come to the conclusion that hyper's thread pool size is too small, this is what we came up with:
small thread pool size + keepalive + no timeouts => server blocked

we tested this using this python script:

https://gist.github.com/jshs/e38eef7aa2c360aef696

and it stopped after trying to send the 2nd request, and the website after was unresponsive.
since sometimes this happens when 2 people connect using browsers, it would take about 60s to
load the page, after the other connection is closed.

Could this be fixed with increasing the thread pool size on hyper's side?

VPS specs: single core

@reem
Copy link
Contributor

reem commented Feb 17, 2015

Hyper's thread pool size is tunable using http://hyperium.github.io/hyper/hyper/server/struct.Server.html#method.listen_threads.

@reem
Copy link
Contributor

reem commented Feb 17, 2015

We do have an issue for pervasive timeouts: #315

@renato-zannon
Copy link
Contributor

@Ap0ph1s I don't know if this is a satisfactory answer for you, but on the web app world it's common to use a reverse proxy (commonly nginx) to serve static files and deal with slow clients. Since nginx is event-driven, it doesn't need a big thread pool to handle a big number of clients, and you can remove that concern from your backend server.

@5nyper
Copy link
Author

5nyper commented Feb 19, 2015

@renato-zannon Thanks! Ill keep that in mind.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants