]> git.proxmox.com Git - pve-manager-legacy.git/commitdiff
disable Nagle algorithm
authorDietmar Maurer <dietmar@proxmox.com>
Tue, 16 Apr 2013 05:42:33 +0000 (07:42 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Tue, 16 Apr 2013 05:47:23 +0000 (07:47 +0200)
PVE/APIDaemon.pm

index 7eabf0cfed653005df779db0773546a7b173e449..8435004a2f5f60219f61bf195450b9fd360bdacb 100755 (executable)
@@ -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;