source: subversion/applications/utils/mod_tile/mod_tile.conf @ 28750

Last change on this file since 28750 was 25096, checked in by frederik, 9 years ago

Fix spelling of "throttling" in mod_tile. This will require a change in your config file if you have been unsing the old, mis-spelled version.

File size: 5.4 KB
Line 
1# This is the Apache server configuration file for providing OSM tile support
2# through mod_tile
3
4LoadModule tile_module modules/mod_tile.so
5
6<VirtualHost *:80>
7    ServerName tile.openstreetmap.org
8    ServerAlias a.tile.openstreetmap.org b.tile.openstreetmap.org c.tile.openstreetmap.org d.tile.openstreetmap.org
9    DocumentRoot /var/www/html
10
11# You can either manually configure each tile set
12#    AddTileConfig /folder/ TileSetName
13
14# or load all the tile sets defined in the configuration file into this virtual host
15    LoadTileConfigFile /etc/renderd.conf
16
17# Timeout before giving up for a tile to be rendered
18    ModTileRequestTimeout 3
19
20# Timeout before giving up for a tile to be rendered that is otherwise missing
21    ModTileMissingRequestTimeout 10
22
23# If tile is out of date, don't re-render it if past this load threshold (users gets old tile)
24    ModTileMaxLoadOld 2
25
26# If tile is missing, don't render it if past this load threshold (user gets 404 error)
27    ModTileMaxLoadMissing 5
28
29# Socket where we connect to the rendering daemon
30    ModTileRenderdSocketName /var/run/renderd/renderd.sock
31
32##
33## Options controlling the cache proxy expiry headers. All values are in seconds.
34##
35## Caching is both important to reduce the load and bandwidth of the server, as
36## well as reduce the load time for the user. The site loads fastest if tiles can be
37## taken from the users browser cache and no round trip through the internet is needed.
38## With minutely or hourly updates, however there is a trade-off between cacheability
39## and freshness. As one can't predict the future, these are only heuristics, that
40## need tuning.
41## If there is a known update schedule such as only using weekly planet dumps to update the db,
42## this can also be taken into account through the constant PLANET_INTERVAL in render_config.h
43## but requires a recompile of mod_tile
44
45## The values in this sample configuration are not the same as the defaults
46## that apply if the config settings are left out. The defaults are more conservative
47## and disable most of the heuristics.
48
49
50##
51## Caching is always a trade-off between being up to date and reducing server load or
52## client side latency and bandwidth requirements. Under some conditions, like poor
53## network conditions it might be more important to have good caching rather than the latest tiles.
54## Therefor the following config options allow to set a special hostheader for which the caching
55## behaviour is different to the normal heuristics
56##
57## The CacheExtended parameters overwrite all other caching parameters (including CacheDurationMax)
58## for tiles being requested via the hostname CacheExtendedHostname
59#ModTileCacheExtendedHostname cache.tile.openstreetmap.org
60#ModTileCacheExtendedDuration 2592000
61
62# Upper bound on the length a tile will be set cacheable, which takes
63# precedence over other settings of cacheing
64ModTileCacheDurationMax 604800
65
66# Sets the time tiles can be cached for that are known to by outdated and have been
67# sent to renderd to be rerendered. This should be set to a value corresponding
68# roughly to how long it will take renderd to get through its queue. There is an additional
69# fuzz factor on top of this to not have all tiles expire at the same time
70ModTileCacheDurationDirty 900
71
72# Specify the minimum time mod_tile will set the cache expiry to for fresh tiles. There
73# is an additional fuzz factor of between 0 and 3 hours on top of this.
74ModTileCacheDurationMinimum 10800
75
76# Lower zoom levels are less likely to change noticeable, so these could be cached for longer
77# without users noticing much.
78# The heuristic offers three levels of zoom, Low, Medium and High, for which different minimum
79# cacheing times can be specified.
80
81#Specify the zoom level below  which Medium starts and the time in seconds for which they can be cached
82ModTileCacheDurationMediumZoom 13 86400
83
84#Specify the zoom level below which Low starts and the time in seconds for which they can be cached
85ModTileCacheDurationLowZoom 9 518400
86
87# A further heuristic to determine cacheing times is when was the last time a tile has changed.
88# If it hasn't changed for a while, it is less likely to change in the immediate future, so the
89# tiles can be cached for longer.
90# For example, if the factor is 0.20 and the tile hasn't changed in the last 5 days, it can be cached
91# for up to one day without having to re-validate.
92ModTileCacheLastModifiedFactor 0.20
93
94## Tile Throttling
95## Tile scrappers can often download large numbers of tiles and overly staining tileserver resources
96## mod_tile therefore offers the ability to automatically throttle requests from ip addresses that have
97## requested a lot of tiles.
98## The mechanism uses a token bucket approach to shape traffic. I.e. there is an initial pool of n tiles
99## per ip that can be requested arbitrarily fast. After that this pool gets filled up at a constant rate
100## The algorithm has to metrics. One based on overall tiles served to an ip address and a second one based on
101## the number of requests to renderd / tirex to render a new tile.
102
103## Overall enable or disable tile throttling
104ModTileEnableTileThrottling Off
105## Parameters (poolsize in tiles and topup rate in tiles per second) for throttling tile serving.
106ModTileThrottlingTiles 10000 1
107## Parameters (poolsize in tiles and topup rate in tiles per second) for throttling render requests.
108ModTileThrottlingRenders 128 0.2
109
110
111###
112###   
113# increase the log level for more detailed information
114    LogLevel debug
115
116</VirtualHost>
117
Note: See TracBrowser for help on using the repository browser.