mod_tile 0.9.1
Renders map tiles with Mapnik and serves them using Apache HTTP Server
Loading...
Searching...
No Matches
mod_tile.h File Reference
#include "protocol.h"
#include "store.h"
#include <apr_tables.h>
#include <netinet/in.h>

Go to the source code of this file.

Classes

struct  delaypool_entry
 Per-client IP token bucket entry in the shared-memory rate-limiting delaypool. More...
struct  delaypool
 Shared-memory rate-limiting state tracking per-IP token buckets and whitelisted prefixes. More...
struct  stats_data
 Shared-memory HTTP response, cache hit/miss, and latency counters exposed via /mod_tile. More...
struct  tile_config_rec
 Per-map-layer configuration record populated from Apache directives or renderd.conf. More...
struct  tile_server_conf
 Per-virtual-host Apache server configuration for mod_tile. More...
struct  tile_request_data
 Per-HTTP-request context stored in Apache's r->request_config across translate_name and handler phases. More...

Macros

#define DELAY_HASHTABLE_SIZE   100057
 Prime bucket count of the per-client IP delaypool hash table.
#define DELAY_HASHTABLE_WHITELIST_SIZE   13
 Maximum number of whitelisted IPv4 addresses exempt from delaypool throttling.
#define AVAILABLE_TILE_BUCKET_SIZE   5000
 Default maximum token bucket capacity for cached tile requests per client IP.
#define AVAILABLE_RENDER_BUCKET_SIZE   65
 Default maximum token bucket capacity for on-demand render requests per client IP.
#define RENDER_TOPUP_RATE   5000000l
 Default render token refill interval in microseconds (1 render token per 5 seconds).
#define TILE_TOPUP_RATE   1000000l
 Default tile token refill interval in microseconds (1 tile token per 1 second).
#define INILINE_MAX   256
 Maximum length in bytes of a single INI configuration key or line buffer.
#define MAX_ZOOM_SERVER   30
 Upper bound on zoom levels tracked in server-side Apache statistics and cache-control arrays.
#define FRESH   1
 Cache/render outcome code: fresh tile served directly from storage without rendering.
#define OLD   2
 Cache/render outcome code: expired (tileOld) tile served stale from storage without re-rendering.
#define FRESH_RENDER   3
 Cache/render outcome code: missing tile newly rendered on demand and served.
#define OLD_RENDER   4
 Cache/render outcome code: expired (tileOld) tile re-rendered on demand and served.
#define VERYOLD_RENDER   5
 Cache/render outcome code: heavily expired (tileVeryOld) tile re-rendered on demand and served.
#define VERYOLD   6
 Cache/render outcome code: heavily expired (tileVeryOld) tile served stale without re-rendering.
#define CAMPOUT   10
 Spin-wait sleep interval in microseconds when contending on the delaypool lock.
#define MAXCAMP   10
 Maximum number of spin-wait iterations before giving up on acquiring the delaypool lock.
#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>"
 Default OpenStreetMap attribution string used when none is configured for a map layer.

Typedefs

typedef struct delaypool_entry delaypool_entry
 Per-client IP token bucket entry in the shared-memory rate-limiting delaypool.
typedef struct delaypool delaypool
 Shared-memory rate-limiting state tracking per-IP token buckets and whitelisted prefixes.
typedef struct stats_data stats_data
 Shared-memory HTTP response, cache hit/miss, and latency counters exposed via /mod_tile.
typedef struct tile_request_data tile_request_data
 Per-HTTP-request context stored in Apache's r->request_config across translate_name and handler phases.

Enumerations

enum  tileState {
  tileUnknown , tileMissing , tileOld , tileVeryOld ,
  tileCurrent
}
 Freshness and existence classification of a requested tile in the storage backend. More...

Macro Definition Documentation

◆ AVAILABLE_RENDER_BUCKET_SIZE

#define AVAILABLE_RENDER_BUCKET_SIZE   65

Default maximum token bucket capacity for on-demand render requests per client IP.

◆ AVAILABLE_TILE_BUCKET_SIZE

#define AVAILABLE_TILE_BUCKET_SIZE   5000

Default maximum token bucket capacity for cached tile requests per client IP.

◆ CAMPOUT

#define CAMPOUT   10

Spin-wait sleep interval in microseconds when contending on the delaypool lock.

◆ DEFAULT_ATTRIBUTION

#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>"

Default OpenStreetMap attribution string used when none is configured for a map layer.

◆ DELAY_HASHTABLE_SIZE

#define DELAY_HASHTABLE_SIZE   100057

Prime bucket count of the per-client IP delaypool hash table.

◆ DELAY_HASHTABLE_WHITELIST_SIZE

#define DELAY_HASHTABLE_WHITELIST_SIZE   13

Maximum number of whitelisted IPv4 addresses exempt from delaypool throttling.

◆ FRESH

#define FRESH   1

Cache/render outcome code: fresh tile served directly from storage without rendering.

◆ FRESH_RENDER

#define FRESH_RENDER   3

Cache/render outcome code: missing tile newly rendered on demand and served.

◆ INILINE_MAX

#define INILINE_MAX   256

Maximum length in bytes of a single INI configuration key or line buffer.

◆ MAX_ZOOM_SERVER

#define MAX_ZOOM_SERVER   30

Upper bound on zoom levels tracked in server-side Apache statistics and cache-control arrays.

◆ MAXCAMP

#define MAXCAMP   10

Maximum number of spin-wait iterations before giving up on acquiring the delaypool lock.

◆ OLD

#define OLD   2

Cache/render outcome code: expired (tileOld) tile served stale from storage without re-rendering.

◆ OLD_RENDER

#define OLD_RENDER   4

Cache/render outcome code: expired (tileOld) tile re-rendered on demand and served.

◆ RENDER_TOPUP_RATE

#define RENDER_TOPUP_RATE   5000000l

Default render token refill interval in microseconds (1 render token per 5 seconds).

Equivalent to ModTileThrottlingRenders <size> 0.2, whose second argument is expressed in render requests per second.

◆ TILE_TOPUP_RATE

#define TILE_TOPUP_RATE   1000000l

Default tile token refill interval in microseconds (1 tile token per 1 second).

Equivalent to ModTileThrottlingTiles <size> 1, whose second argument is expressed in tile requests per second.

◆ VERYOLD

#define VERYOLD   6

Cache/render outcome code: heavily expired (tileVeryOld) tile served stale without re-rendering.

◆ VERYOLD_RENDER

#define VERYOLD_RENDER   5

Cache/render outcome code: heavily expired (tileVeryOld) tile re-rendered on demand and served.

Typedef Documentation

◆ delaypool

typedef struct delaypool delaypool

Shared-memory rate-limiting state tracking per-IP token buckets and whitelisted prefixes.

◆ delaypool_entry

typedef struct delaypool_entry delaypool_entry

Per-client IP token bucket entry in the shared-memory rate-limiting delaypool.

◆ stats_data

typedef struct stats_data stats_data

Shared-memory HTTP response, cache hit/miss, and latency counters exposed via /mod_tile.

◆ tile_request_data

typedef struct tile_request_data tile_request_data

Per-HTTP-request context stored in Apache's r->request_config across translate_name and handler phases.

Enumeration Type Documentation

◆ tileState

enum tileState

Freshness and existence classification of a requested tile in the storage backend.

Enumerator
tileUnknown 

Initial state before storage metadata has been queried.

tileMissing 

Tile does not exist in storage (stat_info.size < 0).

tileOld 

Tile exists in storage but its modification time predates the planet import timestamp.

tileVeryOld 

Tile exists in storage and its age exceeds very_old_threshold.

tileCurrent 

Tile exists in storage and is up-to-date.