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

Move I/O calls to the blocking threadpool #1188

Closed
ethowitz opened this issue Dec 17, 2021 · 0 comments · Fixed by #1190
Closed

Move I/O calls to the blocking threadpool #1188

ethowitz opened this issue Dec 17, 2021 · 0 comments · Fixed by #1190
Assignees
Labels
bug Something isn't working tokenserver

Comments

@ethowitz
Copy link
Contributor

Currently, the verify_token, get_or_create_user, and allocate_user function calls all run on the worker threads Actix initializes to handle requests. This means that, when these calls are waiting for I/O, they are blocking other work from happening. This wouldn't be as much of an issue if Actix spawned many worker threads, but normally, there are only as many workers as there are CPUs on the host. The best solution to this problem is to move these long-running I/O tasks to the blocking threadpool via block, where there are many more threads available to handle concurrent I/O tasks.

@ethowitz ethowitz added bug Something isn't working tokenserver labels Dec 17, 2021
@ethowitz ethowitz self-assigned this Dec 17, 2021
ethowitz pushed a commit that referenced this issue Dec 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working tokenserver
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant