I have a Tornado server running behind Nginx reverse proxy. The proxy is configured with
tcp_nodelay: on. I see there's also an option to call
WebSocketHandler.set_nodelay(True) on a WebSocket instance once it's connected.
Do these two create the same effect? Are there pro's con's for using one over the other? Or both?
Best How To :
In general, if you are using
nodelay and proxies, you should turn it on at all levels to see any benefit. Otherwise any piece of the system that doesn't have
nodelay will insert the delays you're trying to avoid.
According to the nginx docs for
tcp_nodelay, it applies only when a connection is in the keep-alive state, so it will have no effect on proxied websockets.