]> git.openstreetmap.org Git - chef.git/blob - roles/nominatim.rb
nominatim: default to wal level to minimal
[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_timeout => "10min",
25         :checkpoint_completion_target => "0.9",
26         :jit => "off",
27         :shared_buffers => "2GB",
28         :autovacuum_max_workers => "1",
29         :max_parallel_workers_per_gather => "0",
30         :maintenance_work_mem => "10GB",
31         :random_page_cost => "1.5",
32         :effective_cache_size => "60GB",
33         :wal_level => "minimal",
34         :max_wal_senders => "0"
35       }
36     }
37   },
38   :sysctl => {
39     :postgres => {
40       :comment => "Increase shared memory for postgres",
41       :parameters => {
42         "kernel.shmmax" => 26 * 1024 * 1024 * 1024,
43         "kernel.shmall" => 26 * 1024 * 1024 * 1024 / 4096
44       }
45     },
46     :swappiness => {
47       :comment => "Reduce swap usage",
48       :parameters => {
49         "vm.swappiness" => 10
50       }
51     },
52     :network_conntrack_time_wait => {
53       :comment => "Only track completed connections for 30 seconds",
54       :parameters => {
55         "net.netfilter.nf_conntrack_tcp_timeout_time_wait" => "30"
56       }
57     },
58     :network_conntrack_max => {
59       :comment => "Increase max number of connections tracked",
60       :parameters => {
61         "net.netfilter.nf_conntrack_max" => "196608"
62       }
63     }
64   },
65   :nominatim => {
66     :dbadmins => %w[lonvia tomh],
67     :tablespaces => {
68       "dosm" => "/ssd/tablespaces/dosm",
69       "iosm" => "/ssd/tablespaces/iosm",
70       "dplace" => "/ssd/tablespaces/dplace",
71       "iplace" => "/ssd/tablespaces/iplace",
72       "daddress" => "/ssd/tablespaces/daddress",
73       "iaddress" => "/ssd/tablespaces/iaddress",
74       "dsearch" => "/ssd/tablespaces/dsearch",
75       "isearch" => "/ssd/tablespaces/isearch",
76       "daux" => "/ssd/tablespaces/daux",
77       "iaux" => "/ssd/tablespaces/iaux"
78     }
79   }
80 )
81
82 run_list(
83   "recipe[nominatim::default]"
84 )