source: subversion/applications/utils/mod_tile/render_config.h @ 29338

Last change on this file since 29338 was 17338, checked in by apmon, 10 years ago

[renderd] Use a hashtable index to determine pending rendering requests

By eliminating the linear look up of the dirtyQueue for every newly added rendering request, it should be possible
to significantly increase the length of the dirty rendering queue. At the moment the queue length is set to 1000 metatiles,
which at a typical rate of 2 - 3 metatiles a seconds is a buffer of only 5 - 10 minutes. With a much longer
queue, the excess daytime requests can be moved into the quieter night time hours, which could improve the overall long-term
throughput if the server is at its limit of what it can handle.

All operations on the dirty queue should now be O(1).

File size: 2.8 KB
Line 
1#ifndef RENDER_CONFIG_H
2#define RENDER_CONFIG_H
3
4#define MAX_ZOOM 18
5
6// MAX_SIZE is the biggest file which we will return to the user
7#define MAX_SIZE (1 * 1024 * 1024)
8
9// With directory hashing enabled we rewrite the path so that tiles are really stored here instead
10#define DIRECTORY_HASH
11#define HASH_PATH "/var/lib/mod_tile"
12
13// TILE_PATH is where Openlayers with try to fetch the "z/x/y.png" tiles from
14// this is now only used if DIRECTORY_HASH is undefined
15//#define TILE_PATH "/var/www/html/osm_tiles2"
16
17// MAX_LOAD_OLD: if tile is out of date, don't re-render it if past this load threshold (users gets old tile)
18// (This is the default value. Can be overwritten in Apache config with ModTileMaxLoadOld.)
19#define MAX_LOAD_OLD 5
20// MAX_LOAD_MISSING: if tile is missing, don't render it if past this load threshold (user gets 404 error)
21// (This is the default value. Can be overwritten in Apache config with ModTileMaxLoadMissing.)
22#define MAX_LOAD_MISSING 10
23// MAX_LOAD_ANY: give up serving any data if beyond this load (user gets 404 error)
24#define MAX_LOAD_ANY 100
25
26// Location of osm.xml file
27#define RENDERD_CONFIG "/etc/renderd.conf"
28// The XML configuration used if one is not provided
29#define XMLCONFIG_DEFAULT "default"
30// Maximum number of configurations that mod tile will allow
31#define XMLCONFIGS_MAX 10
32
33// Mapnik input plugins (will need to adjust for 32 bit libs)
34#define MAPNIK_PLUGINS "/usr/local/lib64/mapnik/input"
35
36// Default directory to search for fonts. Recursion can be enabled if desired.
37#define FONT_DIR "/usr/local/lib64/mapnik/fonts"
38#define FONT_RECURSE 0
39
40// Typical interval between planet imports, used as basis for tile expiry times
41#define PLANET_INTERVAL (7 * 24 * 60 * 60)
42
43// Planet import should touch this file when complete
44#define PLANET_TIMESTAMP "/planet-import-complete"
45
46// Timeout before giving for a tile to be rendered
47// (This is the default value. Can be overwritten in Apache config with ModTileRequestTimeout.)
48#define REQUEST_TIMEOUT (3)
49#define FD_INVALID (-1)
50
51
52#define MIN(x,y) ((x)<(y)?(x):(y))
53#define MAX(x,y) ((x)>(y)?(x):(y))
54
55#define MAX_CONNECTIONS (2048)
56
57// default for number of rendering threads
58#define NUM_THREADS (4)
59
60// Use this to enable meta-tiles which will render NxN tiles at once
61// Note: This should be a power of 2 (2, 4, 8, 16 ...)
62#define METATILE (8)
63//#undef METATILE
64
65//Fallback to standard tiles if meta tile doesn't exist
66//Legacy - not needed on new installs
67//#undef METATILEFALLBACK
68
69// Metatiles are much larger in size so we don't need big queues to handle large areas
70#ifdef METATILE
71#define QUEUE_MAX (64)
72#define REQ_LIMIT (32)
73#define DIRTY_LIMIT (1000)
74#define HASHIDX_SIZE 2213
75#else
76#define QUEUE_MAX (1024)
77#define REQ_LIMIT (512)
78#define DIRTY_LIMIT (10000)
79#define HASHIDX_SIZE 22123
80#endif
81
82// Penalty for client making an invalid request (in seconds)
83#define CLIENT_PENALTY (3)
84
85#endif
Note: See TracBrowser for help on using the repository browser.