]> git.openstreetmap.org Git - chef.git/commitdiff
Disable JIT and parallel workers for replication with postgres 12
authorTom Hughes <tom@compton.nu>
Sat, 21 Mar 2020 11:11:17 +0000 (11:11 +0000)
committerTom Hughes <tom@compton.nu>
Sat, 21 Mar 2020 11:18:42 +0000 (11:18 +0000)
cookbooks/tile/recipes/default.rb
cookbooks/tile/templates/default/replicate.erb

index 9aa99b9344c6f4bab8bc9e7e08982a5e634942cb..80807a0d3d04081bae44b8c0b8f225ac386c2c7f 100644 (file)
@@ -482,6 +482,7 @@ template "/usr/local/bin/replicate" do
   owner "root"
   group "root"
   mode 0o755
+  variables :postgresql_version => postgresql_version.to_f
 end
 
 systemd_service "expire-tiles" do
index 83fec6fb7d123ff94965c7d0fec93b939bd4f2a9..bdd271f61a044a2c8474e3a22f6be99df3f78ff6 100644 (file)
@@ -17,6 +17,11 @@ exec > /var/log/tile/replicate.log 2>&1
 
 # Change to the replication state directory
 cd /var/lib/replicate
+<% if @postgresql_version >= 12 -%>
+
+# Disable JIT and parallel workers in postgres
+export PGOPTIONS="-c jit=off -c max_parallel_workers_per_gather=0"
+<% end -%>
 
 # Install exit handler
 trap onexit EXIT