NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

I just passed a tirex-batch job to my tirex-master without passing the expiration argument. I just took a brief look into the tirex source but couldn't find anything regarding the default tile expiration time. So how does tirex handle this case? Is there a fixed/default tile lifespan for batch rendered tiles, or does tirex check the database for changes and decides wheter to rerender the tiles at each time a new request comes in?

asked 04 Apr '16, 16:36

ltsstar's gravatar image

ltsstar
66227
accept rate: 0%


This is a misunderstanding. The tirex-batch "expire" option,

   -e, --expire=TIME
           Expire time (seconds since epoch) for jobs. If it starts with '+',
           number of seconds added to current time.

specifies at what time a job should be removed from the queue if it hasn't been executed yet. It has nothing to do with the lifetime of a tile on disk. The default expire time is "never".

How long a tile is kept on disk is not something that Tirex decides; Tirex renders tiles when told so, full stop. Whether or not Tirex is told to render a tile, in a standard tileserver setup, is controlled by mod_tile, the Apache module responsible for delivering tiles. In a normal setup, a tile that is older than the last full planet import will be considered "old" and queued for re-rendering; in the absence of a file indicating the time of the last planet import, a tile older than 3 days will be considered "old". This is hard-coded here: https://github.com/openstreetmap/mod_tile/blob/6b9611aaf763f4f776d1fd363433aac7e25cb34b/src/store_file.c#L41

There are various ways to handle tile expiry. One option is setting the "last full import" timestamp to something last year, and then using the "dirty tile list" that osm2pgsql can produce to change the timestamp of every tile that needs re-rendering to 1970-01-01. This will then cause mod_tile to trigger a re-render if such a tile is reuquested. Alternatively, the re-render can be triggered immediately from the osm2pgsql output, but that would mean that even tiles that are rarely ever looked at but change often, would also be computed often.

permanent link

answered 04 Apr '16, 18:11

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
82.5k927201273
accept rate: 23%

1

excellent answer.

(04 Apr '16, 18:29) ltsstar
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×14

question asked: 04 Apr '16, 16:36

question was seen: 1,988 times

last updated: 04 Apr '16, 18:29

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum