From 1ef97ffe70261c8edae52bfaaf009d43e6472fab Mon Sep 17 00:00:00 2001 From: User for running Openstreetmap-things Date: Sat, 31 Jan 2015 23:43:44 +0100 Subject: [PATCH] change rerendering for zoom 13-14 tiles, change prio for daily rerenderings to be less than the minutely updates --- scripts/dailymaint.sh | 14 +++++++++++--- scripts/doosmupdate.sh | 9 +++++---- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/scripts/dailymaint.sh b/scripts/dailymaint.sh index 5e4bc85..dbe2a41 100755 --- a/scripts/dailymaint.sh +++ b/scripts/dailymaint.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash echo "Daily maintenance starting: `date`" # Delete tiles in zoomlevel 13-14 that are older than 336 hours = 14 days @@ -12,10 +12,18 @@ sudo -u tirex -- /home.local/osm/bin/osmtilecleanup.pl --zoom 15-20 --action del sudo -u tirex -- /home.local/osm/bin/osmtilecleanup.pl --zoom 10-20 --action delete --rmemptydirs --minage 24 /var/lib/tirex/tiles/rrze-ovl # Regenerate a part of zoomlevel 0-12 tiles. There are at most 350000 such tiles. # At 5000 a day, it'll take 70 days to regenerate all. As they hardly ever change, that should be fine. +export PRIO=31 /home.local/osm/bin/osmtilecleanup.pl --zoom 0-12 --action rerender \ --limit 5000 --rrs /home.local/osm/bin/osmrerenderwrapper.sh /var/lib/tirex/tiles/osm /home.local/osm/bin/osmtilecleanup.pl --zoom 0-12 --action rerender \ --limit 5000 --rrs /home.local/osm/bin/osmrerenderwrapper-osmde.sh /var/lib/tirex/tiles/osmde +# Regenerate (part of) zoomlevel 13-14 tiles. Some of these are pretty expensive, so +# we rather rerender them scheduled than when they change (usually they really don't, +# it is 99 percent false alerts). +/home.local/osm/bin/osmtilecleanup.pl --zoom 13-14 --action rerender \ + --limit 1000 --rrs /home.local/osm/bin/osmrerenderwrapper.sh /var/lib/tirex/tiles/osm +/home.local/osm/bin/osmtilecleanup.pl --zoom 13-14 --action rerender \ + --limit 1000 --rrs /home.local/osm/bin/osmrerenderwrapper-osmde.sh /var/lib/tirex/tiles/osmde # Update tile stats for munin tirex-tiledir-check --stats=/var/lib/tirex/stats/tiles-osm.stats osm tirex-tiledir-check --stats=/var/lib/tirex/stats/tiles-osmde.stats osmde @@ -28,8 +36,8 @@ if [ "$DOW" == "6" -o "$DOW" == "3" ] ; then fi # Rerender Erlangen / Nuernberg. Around 4000 tiles, takes around 30 minutes. -tirex-batch --prio=22 --expire=+14400 map=osm bbox=10.93,49.37,11.14,49.63 z=13-19 -tirex-batch --prio=22 --expire=+14400 map=osmde bbox=10.93,49.37,11.14,49.63 z=13-19 +tirex-batch --prio=${PRIO} --expire=+14400 map=osm bbox=10.93,49.37,11.14,49.63 z=13-19 +tirex-batch --prio=${PRIO} --expire=+14400 map=osmde bbox=10.93,49.37,11.14,49.63 z=13-19 echo "Daily maintenance finished: `date`" diff --git a/scripts/doosmupdate.sh b/scripts/doosmupdate.sh index 9491349..3a8fc11 100755 --- a/scripts/doosmupdate.sh +++ b/scripts/doosmupdate.sh @@ -11,7 +11,7 @@ WEBSTATEFILE=/var/www/lastdbupdate.txt UPDATECMD="/usr/bin/osm2pgsql --slim --cache=8000 --append --database=osm \ --style=/home.local/osm/dbstyle/osm2pgsql-new.style \ --flat-nodes=/mnt/database/flatnodes/flatnodes.db \ - --hstore --expire-tiles=17-17 \ + --hstore --multi-geometry --expire-tiles=17-17 \ --expire-output=$EXPIRYFILE $CHANGESFILE" cleanup() @@ -68,16 +68,17 @@ echo "Update seems to have been successful." grep timestamp $OSMOSISWORKDIR/state.txt | sed -e 's/timestamp=//g' -e 's/T/ /g' -e 's/\\:/:/g' > $WEBSTATEFILE echo -n "Updated database: now at upstream state of " cat $WEBSTATEFILE -touch /var/lib/tirex/tiles/planet-import-complete +#touch /var/lib/tirex/tiles/planet-import-complete if [ -e $EXPIRYFILE ] ; then echo "Expiryfile exists. Telling tirex to rerender the tiles mentioned there..." echo "Number of lines: `wc -l $EXPIRYFILE`" + # Used to be zoom 13-20 but that causes too much load. Reduced to 15-20. cat $EXPIRYFILE | /home.local/osm/bin/osmtilecleanup.pl \ - --action rerenderexpiredlist --zoom 13-20 \ + --action rerenderexpiredlist --zoom 15-20 \ --rrs /home.local/osm/bin/osmrerenderwrapper.sh \ /var/lib/tirex/tiles/osm cat $EXPIRYFILE | /home.local/osm/bin/osmtilecleanup.pl \ - --action rerenderexpiredlist --zoom 13-20 \ + --action rerenderexpiredlist --zoom 15-20 \ --rrs /home.local/osm/bin/osmrerenderwrapper-osmde.sh \ /var/lib/tirex/tiles/osmde rm $EXPIRYFILE -- 2.25.1