Closed lesc6 closed 9 months ago
from the code, ws protocol not update total_requests
, so the max requests is not worked. ws is long connection, so it doesn't have request and response, i think it worked as expected.
a client still has to start the WebSocket handshake process by contacting the server and requesting a WebSocket connection. The client will send a pretty standard HTTP request with headers that looks like https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API/Writing_WebSocket_servers
GET /chat HTTP/1.1
Host: example.com:8000
Upgrade: websocket
Connection: Upgrade
Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==
Sec-WebSocket-Version: 13
the problem is more global, suppose you have a web chat that works only on websockets and you have 10 workers that constantly work without rebooting; they constantly increase memory costs, which leads to complete failure of the application.
from the code, ws protocol not update
total_requests
, so the max requests is not worked. ws is long connection, so it doesn't have request and response, i think it worked as expected.
Actually, this is it.
Initial Checks
Discussion Link
Description
If you use independent server for websocket connection, you expect that Worker process will be killed after N requests, but it will never killed it consume more and more memory. use any ws client to reproduce.
Example Code
Python, Uvicorn & OS Version