]> git.openstreetmap.org Git - chef.git/blob - roles/nominatim.rb
foundation: use default mediawiki version
[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     },
9     :groups => {
10       :nominatim => {
11         :members => [:lonvia, :tomh]
12       }
13     }
14   },
15   :networking => {
16     :firewall => {
17       :http_rate_limit => "s:2/sec:15"
18     }
19   },
20   :postgresql => {
21     :settings => {
22       :defaults => {
23         :max_connections => "450",
24         :synchronous_commit => "off",
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         :maintenance_work_mem => "10GB",
32         :seq_page_cost => "3.0",
33         :random_page_cost => "3.0",
34         :effective_cache_size => "60GB",
35         :wal_level => "minimal",
36         :max_wal_senders => "0"
37       }
38     }
39   },
40   :sysctl => {
41     :postgres => {
42       :comment => "Increase shared memory for postgres",
43       :parameters => {
44         "kernel.shmmax" => 26 * 1024 * 1024 * 1024,
45         "kernel.shmall" => 26 * 1024 * 1024 * 1024 / 4096
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   :nominatim => {
68     :dbadmins => %w[lonvia tomh]
69   }
70 )
71
72 run_list(
73   "recipe[nominatim::default]",
74   "recipe[fastly]"
75 )