source: subversion/applications/utils/mod_tile/mod_tile.h @ 29283

Last change on this file since 29283 was 29195, checked in by apmon, 7 years ago

[mod_tile] log and graph time to retrieve tiles from disk

Adds a munin graph to monitor the average time it takes to retrieve a served tile
from disk. This can be useful to check if the underlying disk system is fast enough
to handle the load of serving tiles. It does not include time required for pontential
rendering on the fly, nor the time to deliver the tile over the network.

File size: 3.4 KB
Line 
1#ifndef MODTILE_H
2#define MODTILE_H
3
4/*Size of the delaypool hashtable*/
5#define DELAY_HASHTABLE_SIZE 100057
6#define DELAY_HASHTABLE_WHITELIST_SIZE 13
7/*Number of tiles in the bucket */
8#define AVAILABLE_TILE_BUCKET_SIZE 5000
9/*Number of render request in the bucket */
10#define AVAILABLE_RENDER_BUCKET_SIZE 65
11/*Number of microseconds per render request. Currently set at no more than 1 render request per 5 seconds on average */
12#define RENDER_TOPUP_RATE 5000000l
13/*Number of microseconds per render request. Currently set at no more than 1 request per second on average */
14#define TILE_TOPUP_RATE 1000000l
15
16#define INILINE_MAX 256
17
18#define MAX_ZOOM_SERVER 30
19
20#define FRESH 1
21#define OLD 2
22#define FRESH_RENDER 3
23#define OLD_RENDER 4
24
25/* Number of microseconds to camp out on the mutex */
26#define CAMPOUT 10
27/* Maximum number of times we camp out before giving up */
28#define MAXCAMP 10
29
30#define DEFAULT_ATTRIBUTION "&copy;<a href=\"http://www.openstreetmap.org/\">OpenStreetMap</a> and <a href=\"http://wiki.openstreetmap.org/wiki/Contributors\">contributors</a>, <a href=\"http://opendatacommons.org/licenses/odbl/\">(ODbL)</a>"
31
32typedef struct delaypool_entry {
33        struct in6_addr ip_addr;
34        int available_tiles;
35        int available_render_req;
36} delaypool_entry;
37
38typedef struct delaypool {
39        delaypool_entry users[DELAY_HASHTABLE_SIZE];
40        in_addr_t whitelist[DELAY_HASHTABLE_WHITELIST_SIZE];
41        apr_time_t last_tile_fillup;
42        apr_time_t last_render_fillup;
43        int locked;
44} delaypool;
45
46typedef struct stats_data {
47    apr_uint64_t noResp200;
48    apr_uint64_t noResp304;
49    apr_uint64_t noResp404;
50        apr_uint64_t noResp503;
51    apr_uint64_t noResp5XX;
52    apr_uint64_t noRespOther;
53    apr_uint64_t noFreshCache;
54    apr_uint64_t noFreshRender;
55    apr_uint64_t noOldCache;
56    apr_uint64_t noOldRender;
57        apr_uint64_t noRespZoom[MAX_ZOOM_SERVER + 1];
58    apr_uint64_t totalBufferRetrievalTime;
59    apr_uint64_t noTotalBufferRetrieval;
60    apr_uint64_t zoomBufferRetrievalTime[MAX_ZOOM_SERVER + 1];
61    apr_uint64_t noZoomBufferRetrieval[MAX_ZOOM_SERVER + 1];
62
63    apr_uint64_t *noResp200Layer;
64    apr_uint64_t *noResp404Layer;
65
66} stats_data;
67
68typedef struct {
69    char xmlname[XMLCONFIG_MAX];
70    char baseuri[PATH_MAX];
71    char fileExtension[PATH_MAX];
72    char mimeType[PATH_MAX];
73    const char * description;
74    const char * attribution;
75    const char * cors;
76    char **hostnames;
77    int noHostnames;
78    int minzoom;
79    int maxzoom;
80} tile_config_rec;
81
82typedef struct {
83    apr_array_header_t *configs;
84    int request_timeout;
85        int request_timeout_priority;
86    int max_load_old;
87    int max_load_missing;
88    int cache_duration_dirty;
89    int cache_duration_max;
90    int cache_duration_minimum;
91    int cache_duration_low_zoom;
92    int cache_level_low_zoom;
93    int cache_duration_medium_zoom;
94    int cache_level_medium_zoom;
95    double cache_duration_last_modified_factor;
96    char renderd_socket_name[PATH_MAX];
97    char tile_dir[PATH_MAX];
98        char cache_extended_hostname[PATH_MAX];
99    int  cache_extended_duration;
100    int mincachetime[MAX_ZOOM_SERVER + 1];
101    int enableGlobalStats;
102        int enableTileThrottling;
103    int enableTileThrottlingXForward;
104        int delaypoolTileSize;
105        long delaypoolTileRate;
106        int delaypoolRenderSize;
107        long delaypoolRenderRate;
108    int bulkMode;
109} tile_server_conf;
110
111typedef struct tile_request_data {
112        struct protocol * cmd;
113        int layerNumber;
114} tile_request_data;
115
116enum tileState { tileMissing, tileOld, tileCurrent };
117
118
119#endif
Note: See TracBrowser for help on using the repository browser.