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
"Too many open files" error, regardless of size parameter #54
Comments
One of the things you could do is build a requests.Session object, and either use the default HTTPAdapter or mount a new one with a larger connection pool. Then, grequests/requests will end up doing HTTP Pipelining, reusing the existing connections where possible. Try something like:
if you call You can also mount a new HTTPAdapter with a larger connection pool:
|
@rtdean fixed my problem |
For posterity, just adding a session to the request seems to fix the issue (as @rtdean mentioned): session = requests.Session() |
It would be great if you could add this info to a FAQ section in the README |
We just faced this issue on our servers bringing down the whole service. It would be good to have it in the README. Thank you! |
Please do mention using Session Object in README .As till you complete system shutdown , user won't be searching the issue & end up here on this issue thread . |
@amitsquare @skasturi @bbbco Feel free to create a PR for this :). |
To provide some further context, this is (or at least was) a problem with HTTPS libraries in general... See psf/requests#239 urllib3/urllib3#291 As far as I can tell, this is not a direct issue with grequests, so I'm going to close the issue. As far as updating the README... Personally, I'm not sure it's worthwhile adding to the currently concise README. I see no particular reason to document it than any other issue not specifically within grequest's domain that affects HTTP libraries in general. Though, if someone feels this is particularly useful for grequests users, please feel free to submit a PR. |
I am using grequests to test the performance of my service. Both the service and the machine from which I start the requests are inside Amazon EC2. It seems that I cannot start more requests than
ulimit -n
, even though I explicitly specify the size parameter formap() / imap()
My setup is roughly like this:
Doesn't the
size
parameter here tellgrequests
that it should issue no_requests, 200 at a time?The text was updated successfully, but these errors were encountered: