2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-22 17:43:14 +00:00

Improve interactive latency

While typing in confetty console in blind test and confetty was using a TLS socket,
the confetty console was noticably chunkier.  The chunkiness could not be detected
on a UNIX socket.  Setting NODELAY on both sides of the socket seems to have eliminated
chunkiness so that at least I can't tell confetty from ssh+ipmitool anymore.
This commit is contained in:
Jarrod Johnson 2014-02-22 14:04:43 -05:00
parent 26c95349fc
commit d8619e76b9
2 changed files with 2 additions and 0 deletions

View File

@ -296,6 +296,7 @@ def connect_tls_server(serverstring):
af, socktype, proto, cononname, sa = res
try:
server = socket.socket(af, socktype, proto)
server.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
except:
server = None
continue

View File

@ -133,6 +133,7 @@ def process_request(connection, request, cfm, authdata):
def _tlshandler():
plainsocket = socket.socket()
plainsocket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
plainsocket.setsockopt(socket.SOL_SOCKET, socket.TCP_NODELAY, 1)
srv = ssl.wrap_socket(plainsocket, keyfile="/etc/confluent/privkey.pem",
certfile="/etc/confluent/srvcert.pem",
ssl_version=ssl.PROTOCOL_TLSv1,