]> git.openstreetmap.org Git - chef.git/blob - roles/nominatim.rb
e9c6040c910b999809e52ba6f0cf926d0a75fb15
[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       }
31     }
32   },
33   :sysctl => {
34     :postgres => {
35       :comment => "Increase shared memory for postgres",
36       :parameters => {
37         "kernel.shmmax" => 26 * 1024 * 1024 * 1024,
38         "kernel.shmall" => 26 * 1024 * 1024 * 1024 / 4096
39       }
40     },
41     :kernel_scheduler_tune => {
42       :comment => "Tune kernel scheduler preempt",
43       :parameters => {
44         "kernel.sched_min_granularity_ns" => 10000000,
45         "kernel.sched_wakeup_granularity_ns" => 15000000
46       }
47     },
48     :swappiness => {
49       :comment => "Reduce swap usage",
50       :parameters => {
51         "vm.swappiness" => 10
52       }
53     },
54     :network_conntrack_time_wait => {
55       :comment => "Only track completed connections for 30 seconds",
56       :parameters => {
57         "net.netfilter.nf_conntrack_tcp_timeout_time_wait" => "30"
58       }
59     },
60     :network_conntrack_max => {
61       :comment => "Increase max number of connections tracked",
62       :parameters => {
63         "net.netfilter.nf_conntrack_max" => "196608"
64       }
65     }
66   }
67 )
68
69 run_list(
70   "recipe[nominatim::default]"
71 )