]> git.openstreetmap.org Git - chef.git/blob - roles/nominatim.rb
Increase replication slots
[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       :twain => { :status => :administrator },
9       :nominatim => {
10         :status => :role,
11         :members => [:lonvia, :tomh, :twain]
12       }
13     }
14   },
15   :apache => {
16     :mpm => "event",
17     :timeout => 30,
18     :keepalive => false,
19     :reqtimeout => true,
20     :event => {
21       :server_limit => 100,
22       :max_request_workers => 2400,
23       :threads_per_child => 50,
24       :min_spare_threads => 125,
25       :max_spare_threads => 925,
26       :async_request_worker_factor => 4,
27       :listen_cores_buckets_ratio => 6
28     }
29   },
30   :networking => {
31     :firewall => {
32       :http_rate_limit => "s:2/sec:15"
33     }
34   },
35   :postgresql => {
36     :settings => {
37       :defaults => {
38         :max_connections => "450",
39         :synchronous_commit => "off",
40         :checkpoint_segments => "32",
41         :checkpoint_timeout => "10min",
42         :checkpoint_completion_target => "0.9",
43         :shared_buffers => "2GB",
44         :autovacuum_max_workers => "1"
45       }
46     }
47   },
48   :sysctl => {
49     :postgres => {
50       :comment => "Increase shared memory for postgres",
51       :parameters => {
52         "kernel.shmmax" => 26 * 1024 * 1024 * 1024,
53         "kernel.shmall" => 26 * 1024 * 1024 * 1024 / 4096
54       }
55     },
56     :kernel_scheduler_tune => {
57       :comment => "Tune kernel scheduler preempt",
58       :parameters => {
59         "kernel.sched_min_granularity_ns" => 10000000,
60         "kernel.sched_wakeup_granularity_ns" => 15000000
61       }
62     },
63     :swappiness => {
64       :comment => "Reduce swap usage",
65       :parameters => {
66         "vm.swappiness" => 10
67       }
68     },
69     :network_conntrack_time_wait => {
70       :comment => "Only track completed connections for 30 seconds",
71       :parameters => {
72         "net.netfilter.nf_conntrack_tcp_timeout_time_wait" => "30"
73       }
74     },
75     :network_conntrack_max => {
76       :comment => "Increase max number of connections tracked",
77       :parameters => {
78         "net.netfilter.nf_conntrack_max" => "196608"
79       }
80     }
81   }
82 )
83
84 run_list(
85   "recipe[nominatim::default]"
86 )