I have a simple demo that has two parts: a web application and a Python application, running on the same computer. They communicate with each other using a websocket. The web application sends images with 30 FPS to the Python application, the Python application reads the frames and does some processing (currently, noop, for testing). The issue I am experiencing is that the Python side reads the data super slowly (<1 FPS). In the meantime, the web side builds up some kind of buffer (the memory usage goes up), and if I pause the sending, the Python reader immediately reads the frames crazy fast (40+ FPS). If I slow down the sending side to reduce the buffer to 1 frame, the throughput increases to 10 FPS. Hence, I believe the reading is not the bottleneck but somehow the writing and reading collide and the reading is blocked. Is there any settings to simultaneously write data from one end and read the data from the other end? It might be relevant, this demo runs in Windows with MsEdge browser. Continue reading...