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

Last change on this file since 26038 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: 2.5 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 FRESH 1
19#define OLD 2
20#define FRESH_RENDER 3
21#define OLD_RENDER 4
22
23/* Number of microseconds to camp out on the mutex */
24#define CAMPOUT 10
25/* Maximum number of times we camp out before giving up */
26#define MAXCAMP 10
27
28typedef struct delaypool_entry {
29        in_addr_t ip_addr;
30        int available_tiles;
31        int available_render_req;
32} delaypool_entry;
33
34typedef struct delaypool {
35        delaypool_entry users[DELAY_HASHTABLE_SIZE];
36        in_addr_t whitelist[DELAY_HASHTABLE_WHITELIST_SIZE];
37        apr_time_t last_tile_fillup;
38        apr_time_t last_render_fillup;
39        int locked;
40} delaypool;
41
42typedef struct stats_data {
43    apr_uint64_t noResp200;
44    apr_uint64_t noResp304;
45    apr_uint64_t noResp404;
46        apr_uint64_t noResp503;
47    apr_uint64_t noResp5XX;
48    apr_uint64_t noRespOther;
49    apr_uint64_t noFreshCache;
50    apr_uint64_t noFreshRender;
51    apr_uint64_t noOldCache;
52    apr_uint64_t noOldRender;
53        apr_uint64_t noRespZoom[MAX_ZOOM + 1];
54} stats_data;
55
56typedef struct {
57    char xmlname[XMLCONFIG_MAX];
58    char baseuri[PATH_MAX];
59    int minzoom;
60    int maxzoom;
61} tile_config_rec;
62
63typedef struct {
64    apr_array_header_t *configs;
65    int request_timeout;
66        int request_timeout_priority;
67    int max_load_old;
68    int max_load_missing;
69    int cache_duration_dirty;
70    int cache_duration_max;
71    int cache_duration_minimum;
72    int cache_duration_low_zoom;
73    int cache_level_low_zoom;
74    int cache_duration_medium_zoom;
75    int cache_level_medium_zoom;
76    double cache_duration_last_modified_factor;
77    char renderd_socket_name[PATH_MAX];
78    char tile_dir[PATH_MAX];
79        char cache_extended_hostname[PATH_MAX];
80    int  cache_extended_duration;
81    int mincachetime[MAX_ZOOM + 1];
82    int enableGlobalStats;
83        int enableTileThrottling;
84        int delaypoolTileSize;
85        long delaypoolTileRate;
86        int delaypoolRenderSize;
87        long delaypoolRenderRate;
88} tile_server_conf;
89
90enum tileState { tileMissing, tileOld, tileCurrent };
91
92
93#endif
Note: See TracBrowser for help on using the repository browser.