]> git.openstreetmap.org Git - chef.git/blob - roles/nominatim.rb
Fix rubocop style warning
[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     :event => {
20       :server_limit => 32,
21       :max_clients => 1600,
22       :threads_per_child => 50
23     }
24   },
25   :postgresql => {
26     :settings => {
27       :defaults => {
28         :max_connections => "450",
29         :synchronous_commit => "off",
30         :checkpoint_segments => "50",
31         :checkpoint_timeout => "10min",
32         :checkpoint_completion_target => "0.9",
33         :autovacuum_max_workers => "1"
34       }
35     }
36   },
37   :sysctl => {
38     :postgres => {
39       :comment => "Increase shared memory for postgres",
40       :parameters => {
41         "kernel.shmmax" => 26 * 1024 * 1024 * 1024,
42         "kernel.shmall" => 26 * 1024 * 1024 * 1024 / 4096
43       }
44     },
45     :kernel_scheduler_tune => {
46       :comment => "Tune kernel scheduler preempt",
47       :parameters => {
48         "kernel.sched_min_granularity_ns" => 10000000,
49         "kernel.sched_wakeup_granularity_ns" => 15000000
50       }
51     },
52     :swappiness => {
53       :comment => "Reduce swap usage",
54       :parameters => {
55         "vm.swappiness" => 10
56       }
57     },
58     :network_conntrack_time_wait => {
59       :comment => "Only track completed connections for 30 seconds",
60       :parameters => {
61         "net.netfilter.nf_conntrack_tcp_timeout_time_wait" => "30"
62       }
63     },
64     :network_conntrack_max => {
65       :comment => "Increase max number of connections tracked",
66       :parameters => {
67         "net.netfilter.nf_conntrack_max" => "131072"
68       }
69     }
70   },
71   :nominatim => {
72     :enabled => true,
73     :repository => "git://git.openstreetmap.org/nominatim.git"
74   }
75 )
76
77 run_list(
78   "recipe[nominatim]"
79 )