提交 20048d0a 编写于 作者: S Stefan Hajnoczi

net: use socket_set_nodelay() for -netdev socket

Reduce -netdev socket latency by disabling the Nagle algorithm on
SOCK_STREAM sockets in net/socket.c.  Since we are tunelling Ethernet
over TCP we shouldn't artificially delay outgoing packets, let the guest
decide packet scheduling.

I already get sub-millisecond -netdev socket ping times on localhost, so
there was no measurable difference in my testing.  This won't hurt
though and may improve remote socket performance.
Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: NBenoit Canet <benoit@irqsave.net>
Reviewed-by: NDaniel P. Berrange <berrange@redhat.com>
上级 fe6344a0
......@@ -438,6 +438,9 @@ static NetSocketState *net_socket_fd_init_stream(NetClientState *peer,
s->fd = fd;
s->listen_fd = -1;
/* Disable Nagle algorithm on TCP sockets to reduce latency */
socket_set_nodelay(fd);
if (is_connected) {
net_socket_connect(s);
} else {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册