Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ if(NOT HAVE_POW)
endif()

if(NOT MALLOC_LIB STREQUAL "libc")
message(STATUS "Using '${MALLOC_LIB}' for memory managment")
message(STATUS "Using '${MALLOC_LIB}' for memory management")
if(MALLOC_LIB STREQUAL "jemalloc")
# jemalloc (http://jemalloc.net)
find_library(MALLOC_LIBRARY jemalloc REQUIRED)
Expand Down
2 changes: 1 addition & 1 deletion docs/man/render_expired.1
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Render_expired has three potential strategies of how to expire map tiles:
.BR
2) Delete tiles: Render_expired can delete expired tiles from disk. The next time the tile then gets viewed it will get re-rendered, assuming a dynamic rendering setup like mod_tile is installed
.BR
3) Mark tiles as dirty: A dynamic tile rendering system like mod_tile decides if a tile needs re-rendering by comparing the timestamp of the tile with the time of the planet-import-complet timestamp. Render_expired can set the timestamp of a tile back many years, ensuring it is older than the db import time, thus causeing the tile to be considered dirty and in need for re-render.
3) Mark tiles as dirty: A dynamic tile rendering system like mod_tile decides if a tile needs re-rendering by comparing the timestamp of the tile with the time of the planet-import-complet timestamp. Render_expired can set the timestamp of a tile back many years, ensuring it is older than the db import time, thus causing the tile to be considered dirty and in need for re-render.
.PP
These three strategies can be combined and applied at different zoom levels. E.g. Zoom level 17-18 get deleted, z11 - z16 get marked dirty and z6 - z10 get rendered directly.
.PP
Expand Down
12 changes: 6 additions & 6 deletions etc/apache2/renderd-example-map.conf
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Listen 8081

# Specify if mod_tile should keep tile delivery stats, which can be accessed from the URL /mod_tile
# The default is On. As keeping stats needs to take a lock, this might have some performance impact,
# but for nearly all intents and purposes this should be negligable and so it is safe to keep this turned on.
# but for nearly all intents and purposes this should be negligible and so it is safe to keep this turned on.
ModTileEnableStats On

# Turns on bulk mode. In bulk mode, mod_tile does not request any dirty tiles to be rerendered. Missing tiles
Expand Down Expand Up @@ -87,7 +87,7 @@ Listen 8081
# Caching is always a trade-off between being up to date and reducing server load or
# client side latency and bandwidth requirements. Under some conditions, like poor
# network conditions it might be more important to have good caching rather than the latest tiles.
# Therefor the following config options allow to set a special hostheader for which the caching
# Therefore the following config options allow to set a special hostheader for which the caching
# behaviour is different to the normal heuristics
#
# The CacheExtended parameters overwrite all other caching parameters (including CacheDurationMax)
Expand All @@ -97,7 +97,7 @@ Listen 8081
#ModTileCacheExtendedDuration 2592000

# Upper bound on the length a tile will be set cacheable, which takes
# precedence over other settings of cacheing
# precedence over other settings of caching
ModTileCacheDurationMax 604800

# Sets the time tiles can be cached for that are known to by outdated and have been
Expand All @@ -113,15 +113,15 @@ Listen 8081
# Lower zoom levels are less likely to change noticeable, so these could be cached for longer
# without users noticing much.
# The heuristic offers three levels of zoom, Low, Medium and High, for which different minimum
# cacheing times can be specified.
# caching times can be specified.

#Specify the zoom level below which Medium starts and the time in seconds for which they can be cached
ModTileCacheDurationMediumZoom 13 86400

#Specify the zoom level below which Low starts and the time in seconds for which they can be cached
ModTileCacheDurationLowZoom 9 518400

# A further heuristic to determine cacheing times is when was the last time a tile has changed.
# A further heuristic to determine caching times is when was the last time a tile has changed.
# If it hasn't changed for a while, it is less likely to change in the immediate future, so the
# tiles can be cached for longer.
# For example, if the factor is 0.20 and the tile hasn't changed in the last 5 days, it can be cached
Expand All @@ -140,7 +140,7 @@ Listen 8081
# Overall enable or disable tile throttling
ModTileEnableTileThrottling Off

# Specify if you want to use the connecting IP for throtteling, or use the X-Forwarded-For header to determin the
# Specify if you want to use the connecting IP for throtteling, or use the X-Forwarded-For header to determine the
# 1 - use the client IP address, i.e. the first entry in the X-Forwarded-For list. This works through a cascade of proxies.
# However, as the X-Forwarded-For is written by the client this is open to manipulation and can be used to circumvent the throttling
# 2 - use the last specified IP in the X-Forwarded-For list. If you know all requests come through a reverse proxy
Expand Down
2 changes: 1 addition & 1 deletion src/gen_tile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ static int check_xyz(int x, int y, int z, struct xmlmapconfig *map)
{
int oob, limit;

// Validate tile co-ordinates
// Validate tile coordinates
oob = (z < map->minzoom || z > map->maxzoom);

if (!oob) {
Expand Down
30 changes: 15 additions & 15 deletions src/mod_tile.c
Original file line number Diff line number Diff line change
Expand Up @@ -873,7 +873,7 @@ static int delay_allowed(request_rec *r, enum tileState state)
};

if (memcmp(&(delayp->users[hashkey].ip_addr), &ip, sizeof(struct in6_addr)) == 0) {
/* Repeat the process to determine if we have tockens in the bucket, as the fillup only runs once a client hits an empty bucket,
/* Repeat the process to determine if we have tokens in the bucket, as the fillup only runs once a client hits an empty bucket,
so in the mean time, the bucket might have been filled */
for (j = 0; j < 3; j++) {
// ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "Checking delays: Current poolsize: %i tiles and %i renders\n", delayp->users[hashkey].available_tiles, delayp->users[hashkey].available_render_req);
Expand Down Expand Up @@ -1385,7 +1385,7 @@ static int tile_handler_json(request_rec *r)
len = strlen(buf);

/*
* Add HTTP headers. Make this file cachable for 1 week
* Add HTTP headers. Make this file cacheable for 1 week
*/
md5 = ap_md5_binary(r->pool, (unsigned char *)buf, len);
apr_table_setn(r->headers_out, "ETag",
Expand Down Expand Up @@ -2437,39 +2437,39 @@ static void *merge_tile_config(apr_pool_t *p, void *basev, void *overridesv)
}

static const command_rec tile_cmds[] = {
AP_INIT_FLAG("ModTileBulkMode", mod_tile_enable_bulk_mode, NULL, OR_OPTIONS, "On Off - make all requests to renderd with bulk render priority, never mark tiles dirty"),
AP_INIT_FLAG("ModTileEnableDirtyURL", mod_tile_enable_dirty_url, NULL, OR_OPTIONS, "On Off - whether to handle .../dirty urls "),
AP_INIT_FLAG("ModTileEnableStats", mod_tile_enable_stats, NULL, OR_OPTIONS, "On Off - enable of keeping stats about what mod_tile is serving"),
AP_INIT_FLAG("ModTileEnableStatusURL", mod_tile_enable_status_url, NULL, OR_OPTIONS, "On Off - whether to handle .../status urls "),
AP_INIT_FLAG("ModTileEnableTileThrottling", mod_tile_enable_throttling, NULL, OR_OPTIONS, "On Off - enable of throttling of IPs that excessively download tiles such as scrapers"),
AP_INIT_TAKE1("LoadTileConfigFile", load_tile_config, NULL, OR_OPTIONS, "load an entire renderd config file"),
AP_INIT_FLAG("ModTileBulkMode", mod_tile_enable_bulk_mode, NULL, OR_OPTIONS, "On Off - Make all requests to renderd with bulk render priority, never mark tiles dirty"),
AP_INIT_FLAG("ModTileEnableDirtyURL", mod_tile_enable_dirty_url, NULL, OR_OPTIONS, "On Off - Whether to handle .../dirty urls"),
AP_INIT_FLAG("ModTileEnableStats", mod_tile_enable_stats, NULL, OR_OPTIONS, "On Off - Enable keeping stats about what mod_tile is serving"),
AP_INIT_FLAG("ModTileEnableStatusURL", mod_tile_enable_status_url, NULL, OR_OPTIONS, "On Off - Whether to handle .../status urls"),
AP_INIT_FLAG("ModTileEnableTileThrottling", mod_tile_enable_throttling, NULL, OR_OPTIONS, "On Off - Enable throttling of IPs that excessively download tiles such as scrapers"),
AP_INIT_TAKE1("LoadTileConfigFile", load_tile_config, NULL, OR_OPTIONS, "Load an entire renderd config file"),
AP_INIT_TAKE1("ModTileCacheDurationDirty", mod_tile_cache_duration_dirty_config, NULL, OR_OPTIONS, "Set the cache expiry for serving dirty tiles"),
AP_INIT_TAKE1("ModTileCacheDurationMax", mod_tile_cache_duration_max_config, NULL, OR_OPTIONS, "Set the maximum cache expiry in seconds"),
AP_INIT_TAKE1("ModTileCacheDurationMinimum", mod_tile_cache_duration_minimum_config, NULL, OR_OPTIONS, "Set the minimum cache expiry"),
AP_INIT_TAKE1("ModTileCacheExtendedDuration", mod_tile_cache_extended_duration_config, NULL, OR_OPTIONS, "set length of extended period caching"),
AP_INIT_TAKE1("ModTileCacheExtendedHostName", mod_tile_cache_extended_hostname_config, NULL, OR_OPTIONS, "set hostname for extended period caching"),
AP_INIT_TAKE1("ModTileCacheExtendedDuration", mod_tile_cache_extended_duration_config, NULL, OR_OPTIONS, "Set length of extended period caching"),
AP_INIT_TAKE1("ModTileCacheExtendedHostName", mod_tile_cache_extended_hostname_config, NULL, OR_OPTIONS, "Set hostname for extended period caching"),
AP_INIT_TAKE1("ModTileCacheLastModifiedFactor", mod_tile_cache_duration_last_modified_factor_config, NULL, OR_OPTIONS, "Set the factor by which the last modified determines cache expiry"),
AP_INIT_TAKE1("ModTileEnableTileThrottlingXForward", mod_tile_enable_throttling_xforward, NULL, OR_OPTIONS, "0 1 2 - use X-Forwarded-For http header to determine IP for throttling when available. 0 => off, 1 => use first entry, 2 => use last entry of the caching chain"),
AP_INIT_TAKE1("ModTileEnableTileThrottlingXForward", mod_tile_enable_throttling_xforward, NULL, OR_OPTIONS, "0 1 2 - Use X-Forwarded-For http header to determine IP for throttling when available. 0 => off, 1 => use first entry, 2 => use last entry of the caching chain"),
AP_INIT_TAKE1("ModTileMaxLoadMissing", mod_tile_max_load_missing_config, NULL, OR_OPTIONS, "Set max load for rendering missing tiles"),
AP_INIT_TAKE1("ModTileMaxLoadOld", mod_tile_max_load_old_config, NULL, OR_OPTIONS, "Set max load for rendering old tiles"),
AP_INIT_TAKE1("ModTileMissingRequestTimeout", mod_tile_request_timeout_priority_config, NULL, OR_OPTIONS, "Set timeout in seconds on missing mod_tile requests"),
AP_INIT_TAKE1("ModTileRenderdSocketName", mod_tile_renderd_socket_name_config, NULL, OR_OPTIONS, "Set name of unix domain socket for connecting to rendering daemon"),
AP_INIT_TAKE1("ModTileRequestTimeout", mod_tile_request_timeout_config, NULL, OR_OPTIONS, "Set timeout in seconds on mod_tile requests"),
AP_INIT_TAKE1("ModTileTileDir", mod_tile_tile_dir_config, NULL, OR_OPTIONS, "Set name of tile cache directory"),
AP_INIT_TAKE1("ModTileVeryOldThreshold", mod_tile_very_old_threshold_config, NULL, OR_OPTIONS, "set the time threshold from when an outdated tile ist considered very old and rendered with slightly higher priority."),
AP_INIT_TAKE1("ModTileVeryOldThreshold", mod_tile_very_old_threshold_config, NULL, OR_OPTIONS, "Set the time threshold from when an outdated tile is considered very old and rendered with slightly higher priority."),
AP_INIT_TAKE2("ModTileCacheDurationLowZoom", mod_tile_cache_duration_low_config, NULL, OR_OPTIONS, "Set the minimum cache duration and zoom level for low zoom tiles"),
AP_INIT_TAKE2("ModTileCacheDurationMediumZoom", mod_tile_cache_duration_medium_config, NULL, OR_OPTIONS, "Set the minimum cache duration and zoom level for medium zoom tiles"),
AP_INIT_TAKE2("ModTileRenderdSocketAddr", mod_tile_renderd_socket_address_config, NULL, OR_OPTIONS, "Set address and port of the TCP socket for connecting to rendering daemon"),
AP_INIT_TAKE2("ModTileThrottlingRenders", mod_tile_delaypool_render_config, NULL, OR_OPTIONS, "Set the initial bucket size (number of tiles) and top up rate (tiles per second) for throttling tile request per IP"),
AP_INIT_TAKE2("ModTileThrottlingTiles", mod_tile_delaypool_tiles_config, NULL, OR_OPTIONS, "Set the initial bucket size (number of tiles) and top up rate (tiles per second) for throttling tile request per IP"),
AP_INIT_TAKE3("AddTileMimeConfig", add_tile_mime_config, NULL, OR_OPTIONS, "path, name of renderd config and file extension to use"),
AP_INIT_TAKE_ARGV("AddTileConfig", add_tile_config, NULL, OR_OPTIONS, "path, name of renderd config and optional key-value pairs to use"),
AP_INIT_TAKE3("AddTileMimeConfig", add_tile_mime_config, NULL, OR_OPTIONS, "Set the path, name of renderd config and file extension to use"),
AP_INIT_TAKE_ARGV("AddTileConfig", add_tile_config, NULL, OR_OPTIONS, "Set the path, name of renderd config and optional key-value pairs to use"),
{NULL}
};

module AP_MODULE_DECLARE_DATA tile_module = {
STANDARD20_MODULE_STUFF,
NULL, /* dir config creater */
NULL, /* dir config creator */
NULL, /* dir merger --- default is to override */
create_tile_config, /* server config */
merge_tile_config, /* merge server config */
Expand Down
4 changes: 2 additions & 2 deletions src/render_expired.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#include "store.h"

// macros handling our tile marking arrays (these are essentially bit arrays
// that have one bit for each tile on the repsective zoom level; since we only
// that have one bit for each tile on the respective zoom level; since we only
// need them for meta tile levels, even if someone were to render level 20,
// we'd still only use 4^17 bits = 2 GB RAM (plus a little for the lower zoom
// levels) - this saves us the hassle of working with a tree structure.
Expand Down Expand Up @@ -417,7 +417,7 @@ int main(int argc, char **argv)
char name[PATH_MAX];

// don't do anything if this tile was already requested.
// renderd does keep a list internally to avoid enqueing the same tile
// renderd does keep a list internally to avoid enqueuing the same tile
// twice but in case it has already rendered the tile we don't want to
// cause extra work.
if (TILE_REQUESTED(z - excess_zoomlevels, x >> excess_zoomlevels, y >> excess_zoomlevels)) {
Expand Down
4 changes: 2 additions & 2 deletions src/render_list.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ int main(int argc, char **argv)
break;

case 'G': /* -G, --max-lat */
max_lat = min_max_double_opt(optarg, "maximum latitute", -85.0511, 85.0511);
max_lat = min_max_double_opt(optarg, "maximum latitude", -85.0511, 85.0511);
max_lat_passed = 1;
break;

Expand Down Expand Up @@ -224,7 +224,7 @@ int main(int argc, char **argv)
break;

case 'g': /* -g, --min-lat */
min_lat = min_max_double_opt(optarg, "minimum latitute", -85.0511, 85.0511);
min_lat = min_max_double_opt(optarg, "minimum latitude", -85.0511, 85.0511);
min_lat_passed = 1;
break;

Expand Down
4 changes: 2 additions & 2 deletions src/renderd.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ enum protoCmd rx_request(struct protocol *req, int fd)
item->fd = (req->cmd == cmdDirty) ? FD_INVALID : fd;

#ifdef METATILE
/* Round down request co-ordinates to the neareast N (should be a power of 2)
/* Round down request coordinates to the nearest N (should be a power of 2)
* Note: request path is no longer consistent but this will be recalculated
* when the metatile is being rendered.
*/
Expand Down Expand Up @@ -574,7 +574,7 @@ int server_socket_init(renderd_config *sConfig)
* the slave renderer. It then blocks and waits for the response with no timeout.
* As it only sends one request at a time (there are as many slave_thread threads as there
* are rendering threads on the slaves) nothing gets queued on the slave and should get
* rendererd immediately. Thus overall, requests should be nicely load balanced between
* rendered immediately. Thus overall, requests should be nicely load balanced between
* all the rendering threads available both locally and in the slaves.
*/
void *slave_thread(void * arg)
Expand Down
4 changes: 2 additions & 2 deletions src/store_file_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ static int check_xyz(int x, int y, int z)
{
int oob, limit;

// Validate tile co-ordinates
// Validate tile coordinates
oob = (z < 0 || z > MAX_ZOOM);

if (!oob) {
Expand Down Expand Up @@ -220,7 +220,7 @@ void xyz_to_path(char *path, size_t len, const char *tile_dir, const char *xmlco
{
#ifdef DIRECTORY_HASH
// We attempt to cluster the tiles so that a 16x16 square of tiles will be in a single directory
// Hash stores our 40 bit result of mixing the 20 bits of the x & y co-ordinates
// Hash stores our 40 bit result of mixing the 20 bits of the x & y coordinates
// 4 bits of x & y are used per byte of output
unsigned char i, hash[5];

Expand Down
2 changes: 1 addition & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1154,7 +1154,7 @@ set(DIRECTIVE_ERRORS
"AddTileConfig error, URL path not defined"
"AddTileConfig error, name of renderd config not defined"
"AddTileConfig error, the configured zoom level lies outside of the range supported by this server"
"LoadTileConfigFile takes one argument, load an entire renderd config file"
"LoadTileConfigFile takes one argument, Load an entire renderd config file"
"LoadTileConfigFile error, unable to open config file"
"ModTileCacheDurationDirty argument must be an integer"
"ModTileCacheDurationLowZoom second argument must be an integer"
Expand Down
2 changes: 1 addition & 1 deletion utils/munin/renderd_queue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh
#
# Plugin to monitor queue length of tiles submited for rendering in renderd
# Plugin to monitor queue length of tiles submitted for rendering in renderd
#
# Parameters:
#
Expand Down
Loading