From: Dietmar Maurer Date: Tue, 16 Apr 2013 05:42:33 +0000 (+0200) Subject: disable Nagle algorithm X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=fdbeefcc3c3d4a8578a187ec83b5dfd730e59866;p=pve-manager-legacy.git disable Nagle algorithm --- diff --git a/PVE/APIDaemon.pm b/PVE/APIDaemon.pm index 7eabf0cf..8435004a 100755 --- a/PVE/APIDaemon.pm +++ b/PVE/APIDaemon.pm @@ -3,6 +3,7 @@ package PVE::APIDaemon; use strict; use warnings; use POSIX ":sys_wait_h"; +use Socket qw(IPPROTO_TCP TCP_NODELAY SOMAXCONN); use IO::Socket::INET; use PVE::SafeSyslog; @@ -28,6 +29,10 @@ sub new { ReuseAddr => 1) || die "unable to create socket - $@\n"; + # we ofter observe delays when using Nagle algorithm, + # so we disable that to maximize performance + setsockopt($socket, IPPROTO_TCP, TCP_NODELAY, 1); + my $cfg = { %args }; my $self = bless { cfg => $cfg }, $class;