-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
compression + encoding should probably happen in executor #3201
Comments
here's another problem:
another place with the dumps method can be run in an executor, or perhaps support an async method so caller can run in executor. |
Thanks for the report. Switching all compression/encoding to thread pool can slowdown simple cases. |
I'm going to code something up, will submit pr since this is high priority for us |
ok, have a first stab at this, let me know what you guys think |
Looks like this was fixed in #3205. |
I just implemented a watchdog utility for our aiohttp servers which tracks when the main thread hangs for more than 5 seconds, and it caught the below callstack. This response returned a large json object with compression enabled. Based on the callstack I think probably compression should be done in a background thread otherwise the web-server can get blocked for several seconds and cause the health checks to fail (note in AWS the default is 5s so if any operation takes more than 5s your server may get recycled).
probably use
run_in_executor
?The text was updated successfully, but these errors were encountered: