]> git.openstreetmap.org Git - chef.git/blobdiff - roles/tilecache.rb
tilecache: increase somaxconn
[chef.git] / roles / tilecache.rb
index 12457a4ca7cc78dd489b26d3c133420788486c8f..645d107d0e57c7706730e0aae1b4e42c7be61587 100644 (file)
@@ -12,10 +12,19 @@ default_attributes(
   :apt => {
     :sources => ["nginx"]
   },
+  :networking => {
+    :tcp_fastopen_key => "tile"
+  },
   :nginx => {
-    :access_log => nil
+    :access_log => false
   },
   :sysctl => {
+    :sockets => {
+      :comment => "Increase size of connection queue",
+      :parameters => {
+        "net.core.somaxconn" => 10000
+      }
+    },
     :network_conntrack_time_wait => {
       :comment => "Only track completed connections for 30 seconds",
       :parameters => {
@@ -25,7 +34,13 @@ default_attributes(
     :network_conntrack_max => {
       :comment => "Increase max number of connections tracked",
       :parameters => {
-        "net.netfilter.nf_conntrack_max" => "262142"
+        "net.netfilter.nf_conntrack_max" => "524288"
+      }
+    },
+    :network_local_port_range => {
+      :comment => "Increase available local port range",
+      :parameters => {
+        "net.ipv4.ip_local_port_range" => "4096 64000"
       }
     },
     :kernel_tfo_listen_enable => {
@@ -39,6 +54,13 @@ default_attributes(
       :parameters => {
         "vm.swappiness" => "30"
       }
+    },
+    :sched_wakeup => {
+      :comment => "Tune scheduler",
+      :parameters => {
+        "kernel.sched_min_granularity_ns" => "10000000",
+        "kernel.sched_wakeup_granularity_ns" => "15000000"
+      }
     }
   }
 )