Tech

websocket output buffers and slow consumers

a WSS connection can stay open while the data waiting to be sent keeps growing in memory. calling send() does not mean the client received the message. it does not mean the client processed it either. outgoing data passes through several layers: the application's queue, the websocket library, TLS and the kernel's TCP send buffer. the exact buffering depends on the implementation. if the connection cannot drain data fast enough, pending bytes accumulate. for a queue receiving r_in bytes/s
Show more

Archive