From a31cf04bd7798300926bc2f2d80e6609eaaa1596 Mon Sep 17 00:00:00 2001 From: Paul Norman Date: Tue, 20 May 2025 00:57:56 -0700 Subject: [PATCH] vectortile: Analyze DBs daily --- .../vectortile/templates/default/render-lowzoom.erb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cookbooks/vectortile/templates/default/render-lowzoom.erb b/cookbooks/vectortile/templates/default/render-lowzoom.erb index cc8c87ae6..51d630472 100644 --- a/cookbooks/vectortile/templates/default/render-lowzoom.erb +++ b/cookbooks/vectortile/templates/default/render-lowzoom.erb @@ -1,6 +1,11 @@ #!/bin/sh set -eu +# The source daily vaccum is best placed before the tilegen, as it has marginal speed benefits +vacuumdb --analyze \ +-j "<%= node[:vectortile][:replication][:threads] %>" \ +-d "<%= @source_database %>" + <%= @tilekiln_bin %> generate zooms \ --source-dbname "<%= @source_database %>" \ --storage-dbname "<%= @storage_database %>" \ @@ -8,3 +13,8 @@ set -eu --config <%= @config_path %> \ --min-zoom <%= @min_zoom %> \ --max-zoom <%= @max_zoom %> + +# the daily render can add bloat, so the vacuum is done after it on the tile DB +vacuumdb --analyze \ +-j "<%= node[:vectortile][:replication][:threads] %>" \ +-d "<%= @storage_database %>" -- 2.39.5