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

API requests to /backups occasionally times out? #767

Open
Sumukh opened this issue Jul 28, 2016 · 2 comments
Open

API requests to /backups occasionally times out? #767

Sumukh opened this issue Jul 28, 2016 · 2 comments

Comments

@Sumukh
Copy link
Member

Sumukh commented Jul 28, 2016

API requests to /backups occasionally (9 times in the past 6 days) sometimes result in a gunicorn worker timing out.

getsentry/raven-python#675

This timeout is specifically when gunicorn kills the worker because it was taking too long to respond. Maybe a busy loop or something like that. So this goes unnoticed.

It seems to only be in the backups API endpoint and one other response - so it's possible that these requests are just taking longer to fulfill.

A temporary fix is to increase the worker timeout to say 60 seconds instead of 30. Gunicorn seems to discourage this though.

Generally set to thirty seconds. Only set this noticeably higher if you’re sure of the repercussions for sync workers. For the non sync workers it just means that the worker process is still communicating and is not tied to the length of time required to handle a single request.

@Sumukh Sumukh changed the title Increase Gunicorn Worker Timeouts Increase Gunicorn Worker Timeouts? Jul 28, 2016
@knrafto
Copy link
Contributor

knrafto commented Jul 28, 2016

So does that mean some requests to /backups take longer than 30 seconds? Why is that?

@knrafto knrafto changed the title Increase Gunicorn Worker Timeouts? API requests to /backups occasionally times out? Aug 10, 2016
@knrafto knrafto removed the Version 3 label Aug 11, 2016
@Sumukh
Copy link
Member Author

Sumukh commented Aug 30, 2016

It's because the request to google to get auth information is taking too long.

from the logs/traceback:

flask_oauthlib Request 'https://www.googleapis.com/oauth2/v1/userinfo' with 'GET' method
10:40:14 requests GET https://www.googleapis.com/oauth2/v1/userinfo
10:40:45 exception SystemExit: 1

I think a solution would be to get userinfo from cache instead of hitting google everytime (with an expiry of an hour).

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

No branches or pull requests

2 participants