]> git.openstreetmap.org Git - chef.git/blob - roles/nominatim.rb
Update piwik to 4.6.1
[chef.git] / roles / nominatim.rb
1 name "nominatim"
2 description "Role applied to all nominatim servers."
3
4 default_attributes(
5   :accounts => {
6     :users => {
7       :lonvia => { :status => :administrator },
8       :nominatim => {
9         :status => :role,
10         :members => [:lonvia, :tomh]
11       }
12     }
13   },
14   :networking => {
15     :firewall => {
16       :http_rate_limit => "s:2/sec:15"
17     }
18   },
19   :postgresql => {
20     :settings => {
21       :defaults => {
22         :max_connections => "450",
23         :synchronous_commit => "off",
24         :checkpoint_segments => "32",
25         :checkpoint_timeout => "10min",
26         :checkpoint_completion_target => "0.9",
27         :jit => "off",
28         :shared_buffers => "2GB",
29         :autovacuum_max_workers => "1",
30         :max_parallel_workers_per_gather => "0"
31       }
32     }
33   },
34   :sysctl => {
35     :postgres => {
36       :comment => "Increase shared memory for postgres",
37       :parameters => {
38         "kernel.shmmax" => 26 * 1024 * 1024 * 1024,
39         "kernel.shmall" => 26 * 1024 * 1024 * 1024 / 4096
40       }
41     },
42     :kernel_scheduler_tune => {
43       :comment => "Tune kernel scheduler preempt",
44       :parameters => {
45         "kernel.sched_min_granularity_ns" => 10000000,
46         "kernel.sched_wakeup_granularity_ns" => 15000000
47       }
48     },
49     :swappiness => {
50       :comment => "Reduce swap usage",
51       :parameters => {
52         "vm.swappiness" => 10
53       }
54     },
55     :network_conntrack_time_wait => {
56       :comment => "Only track completed connections for 30 seconds",
57       :parameters => {
58         "net.netfilter.nf_conntrack_tcp_timeout_time_wait" => "30"
59       }
60     },
61     :network_conntrack_max => {
62       :comment => "Increase max number of connections tracked",
63       :parameters => {
64         "net.netfilter.nf_conntrack_max" => "196608"
65       }
66     }
67   }
68 )
69
70 run_list(
71   "recipe[nominatim::default]"
72 )