On Wed, Feb 27, 2013 at 03:05:47PM +0100, Stefan Hajnoczi wrote: > 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: Stefan Hajnoczi <stefa...@redhat.com>
ACK. Signed-off-by: Daniel P. Berrange <berra...@redhat.com> > --- > net/socket.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/net/socket.c b/net/socket.c > index 396dc8c..c0dcc31 100644 > --- a/net/socket.c > +++ b/net/socket.c > @@ -439,6 +439,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 { > -- Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|