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