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