You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We use aiohttp server and StreamResponse.enable_compression() method for compression such data like images.
And under high load (when we downloading a lot of data by multiple clients) response.write() hangs with 100% CPU load.
After changing this line of code: https://github.com/aio-libs/aiohttp/blob/master/aiohttp/http_writer.py#L66
from self._compress = zlib.compressobj(wbits=zlib_mode) to self._compress = zlib.compressobj(wbits=zlib_mode, strategy=zlib.Z_HUFFMAN_ONLY) the problem disappeared, CPU load decreased and response.write() didn't hang.
Is your feature request related to a problem?
We use aiohttp server and StreamResponse.enable_compression() method for compression such data like images.
And under high load (when we downloading a lot of data by multiple clients) response.write() hangs with 100% CPU load.
After changing this line of code: https://github.com/aio-libs/aiohttp/blob/master/aiohttp/http_writer.py#L66
from
self._compress = zlib.compressobj(wbits=zlib_mode)
toself._compress = zlib.compressobj(wbits=zlib_mode, strategy=zlib.Z_HUFFMAN_ONLY)
the problem disappeared, CPU load decreased and response.write() didn't hang.Describe the solution you'd like
Change this method from:
to kind of that
Describe alternatives you've considered
Have no idea about alternatives
Related component
Server
Additional context
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: