-
Notifications
You must be signed in to change notification settings - Fork 35
Description
Description
If I display a large image in a script, it leads to the formation of a huge message via websocket.
A large message blocks event loop because the message is compressed using zlib in websockets library. This is CPU bound operation.
I saw that compression is disabled by default in Jupiter_server (see hear). Because of this, there is no such problem in it. I tried to enable compression there. There, the loop element also began to hang.
Thus, I consider it important to disable compression for us too.
Unfortunately I have not found a way to do this other than making corrections in anycorn. I created a issue in hypercorn (see hear).
Please discuss this issue. Is it possible to make a correction in anycorn directly? Need to remove the hardcode of compression extension installation. I checked - it works.
Reproduce
As an example, you can use this code, placing a 10+ MB image next to it.
from PIL import Image
Image.open('/user/image.jpg')In parallel, you can run a ping to the status handle. It will hang while the image is being sent.
Expected behavior
Pings will work, since event loop will be switched.