]> git.openstreetmap.org Git - chef.git/blob - roles/tilecache.rb
Make nginx cookbook default to using the nginx upstream repository
[chef.git] / roles / tilecache.rb
1 name "tilecache"
2 description "Role applied to all tile cache servers"
3
4 default_attributes(
5   :accounts => {
6     :groups => {
7       :proxy => {
8         :members => [:tomh, :grant, :matt, :jburgess]
9       }
10     }
11   },
12   :networking => {
13     :tcp_fastopen_key => "tile"
14   },
15   :nginx => {
16     :access_log => false,
17     :cache => {
18       :proxy => {
19         :enable => true,
20         :keys_zone => "proxy_cache_zone:128M"
21       }
22     }
23   },
24   :sysctl => {
25     :sockets => {
26       :comment => "Increase size of connection queue",
27       :parameters => {
28         "net.core.somaxconn" => 10000
29       }
30     },
31     :network_conntrack_time_wait => {
32       :comment => "Only track completed connections for 30 seconds",
33       :parameters => {
34         "net.netfilter.nf_conntrack_tcp_timeout_time_wait" => "30"
35       }
36     },
37     :network_conntrack_max => {
38       :comment => "Increase max number of connections tracked",
39       :parameters => {
40         "net.netfilter.nf_conntrack_max" => "524288"
41       }
42     },
43     :network_local_port_range => {
44       :comment => "Increase available local port range",
45       :parameters => {
46         "net.ipv4.ip_local_port_range" => "1024\t65535"
47       }
48     },
49     :network_tcp_timewait_reuse => {
50       :comment => "Allow tcp timewait reuse",
51       :parameters => {
52         "net.ipv4.tcp_tw_reuse" => 1
53       }
54     },
55     :kernel_tfo_listen_enable => {
56       :comment => "Enable TCP Fast Open for listening sockets",
57       :parameters => {
58         "net.ipv4.tcp_fastopen" => 3
59       }
60     },
61     :squid_swappiness => {
62       :comment => "Prefer not to swapout to free memory",
63       :parameters => {
64         "vm.swappiness" => "1"
65       }
66     },
67     :sched_wakeup => {
68       :comment => "Tune scheduler",
69       :parameters => {
70         "kernel.sched_min_granularity_ns" => "10000000",
71         "kernel.sched_wakeup_granularity_ns" => "15000000"
72       }
73     }
74   },
75   :tools => {
76     :cron => {
77       :load => {
78         :nice => 19,
79         :io_scheduling_class => "best-effort",
80         :io_scheduling_priority => 7
81       }
82     }
83   }
84 )
85
86 run_list(
87   "recipe[tilecache]"
88 )