]> git.openstreetmap.org Git - chef.git/blob - roles/tile.rb
tile: Test using IPv6 socket to workaround https://github.com/openstreetmap/operation...
[chef.git] / roles / tile.rb
1 name "tile"
2 description "Role applied to all tile servers"
3
4 default_attributes(
5   :accounts => {
6     :users => {
7       :pnorman => { :status => :administrator },
8       :tile => {
9         :members => [:jburgess, :tomh, :pnorman]
10       }
11     }
12   },
13   :apache => {
14     :mpm => "event",
15     :listen_address => "[::]",
16     :timeout => 60,
17     :evasive => {
18       :enable => false
19     },
20     :event => {
21       :threads_per_child => 20,
22       :min_spare_threads => 300,
23       :max_connections_per_child => 0,
24       :async_request_worker_factor => 4,
25       :listen_cores_buckets_ratio => 8
26     }
27   },
28   :postgresql => {
29     :settings => {
30       :defaults => {
31         :max_connections => "250",
32         :shared_buffers => "16GB",
33         :work_mem => "128MB",
34         :maintenance_work_mem => "8GB",
35         :max_parallel_workers_per_gather => "0",
36         :wal_level => "minimal",
37         :wal_buffers => "1024kB",
38         :wal_writer_delay => "500ms",
39         :checkpoint_timeout => "60min",
40         :commit_delay => "10000",
41         :max_wal_size => "10GB",
42         :max_wal_senders => "0",
43         :jit => "off",
44         :track_activity_query_size => "16384",
45         :autovacuum_vacuum_scale_factor => "0.05",
46         :autovacuum_analyze_scale_factor => "0.02"
47       }
48     }
49   },
50   :ruby => {
51     :fullstaq => false
52   },
53   :ssl => {
54     :ct_report_uri => false
55   },
56   :sysctl => {
57     :sockets => {
58       :comment => "Increase size of connection queue",
59       :parameters => {
60         "net.core.somaxconn" => 10000
61       }
62     },
63     :network_conntrack_time_wait => {
64       :comment => "Only track completed connections for 30 seconds",
65       :parameters => {
66         "net.netfilter.nf_conntrack_tcp_timeout_time_wait" => "30"
67       }
68     },
69     :network_conntrack_max => {
70       :comment => "Increase max number of connections tracked",
71       :parameters => {
72         "net.netfilter.nf_conntrack_max" => "524288"
73       }
74     },
75     :no_tcp_slow_start => {
76       :comment => "Disable TCP slow start",
77       :parameters => {
78         "net.ipv4.tcp_slow_start_after_idle" => "0"
79       }
80     },
81     :tcp_use_bbr => {
82       :comment => "Use TCP BBR Congestion Control",
83       :parameters => {
84         "net.core.default_qdisc" => "fq",
85         "net.ipv4.tcp_congestion_control" => "bbr"
86       }
87     }
88   },
89   :tile => {
90     :database => {
91       :style_file => "/srv/tile.openstreetmap.org/styles/default/openstreetmap-carto.style",
92       :tag_transform_script => "/srv/tile.openstreetmap.org/styles/default/openstreetmap-carto.lua",
93       :external_data_script => "/srv/tile.openstreetmap.org/styles/default/scripts/get-external-data.py -c /srv/tile.openstreetmap.org/styles/default/external-data.yml",
94       :external_data_tables => %w[
95         icesheet_outlines
96         icesheet_polygons
97         ne_110m_admin_0_boundary_lines_land
98         simplified_water_polygons
99         water_polygons
100       ]
101     },
102     :styles => {
103       :default => {
104         :repository => "https://github.com/gravitystorm/openstreetmap-carto.git",
105         :revision => "v5.9.0",
106         :fonts_script => "/srv/tile.openstreetmap.org/styles/default/scripts/get-fonts.sh",
107         :functions_script => "/srv/tile.openstreetmap.org/styles/default/functions.sql",
108         :max_zoom => 19
109       }
110     }
111   }
112 )
113
114 run_list(
115   "recipe[tile]"
116 )