Commit Graph

47 Commits

Author SHA1 Message Date
122fc84fbc dynamically allocate memory for per-layer statistics; do not segfault
when more than XMLCONFIGS_MAX layers in use.
2012-06-23 20:05:19 +00:00
f3bdcad327 whitespace fixes 2012-06-23 19:28:43 +00:00
bc9a9f7923 [mod_tile] Add a few more debuging log messages to track down issues in tile serving pathway 2012-03-24 19:48:49 +00:00
e6535fa6a5 [mod_tile] Fix /dirty and /status
The sscanf expression to parse the URL was too greedy, lumping the /dirty and /status into the file extension,
causing the tile layers being rejected due to a wrong file extension.
2012-02-02 07:52:08 +00:00
40aa23d3b5 [mod_tile] Fix AddTileConfig AddTileMimeConfig
In the commit to add support for other file extensions other than png,
AddTileConfig configuration was broken due to a typo.

Bug reported by Sven Geggus and Frederik Ramm
2012-01-29 18:17:49 +00:00
68c2dcbcde [mod_tile] Make it possible to serve tiles other than .png.
Make it possible to serve tiles other than raster png files,
e.g. jpeg or javascript vector tiles.

This adds a configuration parameter to tile layers specifying the
file extension and mimetype. The default remain image/png.
2012-01-01 18:46:51 +00:00
a31b71df9e [mod_tile] Allow for per tile style planet-import-complete
If you have several styles served from the same mod_tile, it might be desirable to have
different planet-import-complete dates. This can for example be used if the style sheet changes
and a complete re-render is needed.

It first checks the planet-import-complete file in the tile directory of the style and if the file doesn't
exist checks in the root tile directory.
2011-12-31 17:51:43 +00:00
97a18242ab [mod_tile] Add per tile-layer stats.
If mod_tile serves many different tile styles, it might be interesting how havily various
layers are used and which layers particularly have many 404 errors due to not rendering fast enough.
2011-12-31 11:36:19 +00:00
a3bd1d17b4 Add a new "bulk mode" to mod_tile. If your server is in bulk mode, it will
never mark tiles dirty and never re-render dirty tiles, and it will always
enqueue tiles at "bulk" priority.
2011-12-05 11:05:01 +00:00
1a481afe03 Compile fix my previous checkin 2011-07-16 23:01:39 +00:00
82f097736e mod_tile: fiddle with debug log levels to try and make it easier to spot misconfigurations of the tileserver 2011-07-16 22:58:19 +00:00
194ce4fa70 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. 2011-01-19 13:23:52 +00:00
e86b59c5d0 option is called MissingTimeout not PriorityTimeout 2010-09-07 13:37:12 +00:00
3b6a927cd7 Add a tile traffic shaping / throtteling feature to mod_tile
Tile scrapers can often overburden the resources available to a tileserver by requesting large areas at high zooms.
Rather than banning these users from the tileserver, this patch adds the ability to mod_tile to automatically throttle
these clients to acceptable limits.

It uses a token bucket implementation with configurable bucket size and top up rate. Accounting is done in a hashtable
with a small possibility of ip hashtable clashes

The code also supports whitelisting a few ip addresses, such as proxy servers or CDN nodes, although at the moment
there is no way to configure these ip's other than through adding them to the code and recompiling.
2010-08-25 23:48:40 +00:00
7a96c5e2ae Splitt out timeouts in mod_tile for standard and priority rendering
Allow for a longer timeout on requests that are missing and thus would cause a 404,
than for tiles that would just be served out of date
2010-05-02 16:35:19 +00:00
3e592ac801 [mod_tile] Add a config parameter to overwrite caching-header heuristics based on hostname
This allows to have hostname aliases (e.g. cache.tile.openstreetmap.org) to become more (or less)
cache friendly, to tune the trade off between up-to-dateness and minimizing network resources
2010-03-06 22:03:49 +00:00
d53c3cd447 [mod_tile renderd munin] report mod_tile / renderd usage by zoom level via munin 2010-03-05 18:35:10 +00:00
e7488b3f80 mod_tile: /dirty was potentially submitting tiles twice for rendering and with the wrong priority, as it was using the
normal request pathway in addition to the /dirty pathway.

 --This line, and those below, will be ignored--

M    mod_tile.c
2009-11-15 10:42:22 +00:00
7db883b0e4 mod_tile: Allow URI strings with or without a trailing slash. Previously a missing slash would cause the rendering to fail. Closes trac ticket 2428 2009-11-10 21:54:56 +00:00
54c5306295 [mod_tile / renderd] Add two more priority levels into the queues of renderd
In addition to the request queue and the dirty queue, there are now also a requestPrio and requestBulk queue.
The rendering order now is first render requests from requestPrio, then from request followed by the
dirty queue and finally if no other requests are queued, render from the requestBulk queue.

RequestPrio, Request and RequestBulk all block, whereas Diry immediately returns with NotDoneYet.

This also changes mod_tile to submit requests that if not rendered in time would result in 404 errors as high priority.

prioBulk should be useful for things like rerendering all the outdated tiles in the background, but this patch
does not include those changes.
2009-09-18 21:45:58 +00:00
76aee081f9 Update mod_tile to open & close connection to renderd on each rendering request. This helps the scalability since otherwise renderd runs into select() limits at around 1000 Apache threads. Typically about 1 in 100 HTTP requests triggers a call to renderd. 2009-09-16 20:11:53 +00:00
f49b510ebd [mod_tile] Output some stats on what mod_tile returns
This patch reports two properties of the served tiles. First it reports how many tiles are returned with which response code, i.e.
how many tiles get return with http code 200, 304, 404 or 500. Secondly, it reports if tiles are returned fresh from disk, fresh
after being rendered on the spot, old without attempting to render, old after timing out waiting for the tile to be rendered.

The stats get reported through a special page at "http://servername/mod_tile".

Caveat: In order to report the stats of a global counter, a mutex is needed that serialises access to that counter. This can have
some performance effects, although it is attempted to hold this lock as short as possible. Measuring the effect with apache bench,
running for 1 million tile requests at a concurrency level of 10, this gave about a slowdown of 1%. This should be pretty much
worst case, as apache bench always requests the same tile, so that is all in cache. With this, it still achieves more than 5800
requests per second at 50Mb/s on a dual core laptop. On different hardware, this can obviously differ.

Stats reporting can be disabled with a config setting in mod_tile.conf

The locking code is based on mod_example_ipc.c
2009-07-08 23:12:45 +00:00
73555033f5 [mod_tile] Fixup configuration handling of the cache-expire settings
The initialisation of the per zoom level cache expire table was done in the wrong
section of the configuration parsing. This meant the results were order dependent in statements in mod_tile.conf,
as some of the values might not have been correctly set at that time of calculating the table.
2009-07-08 19:54:20 +00:00
0dc364c546 [mod_tile] remove unnecessary code from my previous commit, noticed by jonb 2009-06-14 12:05:32 +00:00
62d025ae60 another step towards making tile directory configurable at runtime (still some places left that use hardcoded HASH_PATH) 2009-06-12 10:09:08 +00:00
17afb7549c typo fixes 2009-06-12 09:23:29 +00:00
e541c64a8b [mod_tile] Add a bunch of heuristics to determin the cache expiry of tiles
Achieving a high cache hit ratio is both beneficial to clients and the server. For the clients it is
reduced loading time and for the server reduced resources used. To achieve this, cache expiries should be set
as long as possible. However, this conflicts with wanting up to date tiles, especially with minutely renderings.
As you can't predict the future, one can only use a bunch of heuristics.

With this patch, the tile expiry heuristic is based on three factors. The frequency of planet updates (the heuristic used so far),
the zoom level and the last modified time. The idea behind the zoom level heuristic is that low zoom tiles don't change noticably
very often, and so can use longer cache expiries than high zoom tiles. The last modified heuristic is based on the assumption
that a tile that hasn't changed for a while is more likely to stay unchanged than one that has recently been modified.

The heuristics have a bunch of tunables that can be set in the apache config of mod_tile
2009-06-10 22:14:58 +00:00
29080ad2ec More changes to make the tile cache directory configurable at runtime
* -t|--tile-dir option for render_list and convert_meta
* renderd reads it from renderd.conf section "[renderd]" setting "tile_dir"
* mod_tile reads from Apache conf ModTileTileDir directive
There are still some places in store.c left, where HASH_DIR is used directly. More fixes needed.
2009-06-10 16:26:12 +00:00
875a253533 Renderd uses iniparser3.0b ini file parser now which is included
Made renderd more configurable at runtime: socketname, num_threads and the mapnik settings plugins_dir, font_dir, and font_dir_recurse are now available through renderd.conf
    There should be only one incompatible change: the [Default] section in the config is now in all lowercase "[default]" because the parser lib gives section and key names back in lowercase
2009-06-09 15:34:15 +00:00
3b1ad8432f - Added Apache config options for MAX_LOAD_OLD, MAX_LOAD_MISSING and REQUEST_TIMEOUT, defined in C code are only default values now
- Preparation for adding minzoom and maxzoom to config
2009-06-04 16:09:02 +00:00
1a3958cf0d mod_tile: New apache directives and options for multiple tile sets 2009-01-05 22:43:54 +00:00
9b7197c889 mod_tile: Fix negative expiry times. Closes #1040 2008-07-16 21:19:32 +00:00
ef0a4b044f mod_tile: update algorithm used to calculate expiry time. Now next planet dump + random(0..3 hours). 2008-07-13 12:59:40 +00:00
007fee044c mod_tile: Switch to using a md5 etag to improve caching of unchanging tiles 2008-07-13 11:33:26 +00:00
4d4be55daf mod_tile: Switch over to using apr_stat and apr_time_t. Add Last-Modified and ETags headers. Obey conditional gets (If-Modified-Since etc). Fixes bug 1024. Remove redundant output_hook for adding expiry. 2008-07-12 23:42:12 +00:00
4794bbc6ca mod_tile: Move map style & font location into render_config.h. Fix up operation with non-metatile rendering. Several utilities are not implemented for non-metatile (render_list, render_old, speedtest). 2008-06-23 21:55:47 +00:00
6c9caedea9 mod_tile: Fix segv crash due to signed/unsigned mismatch error 2008-06-10 18:56:13 +00:00
315a91c8c0 mod_tile: Fix compile warning 2008-03-12 23:06:05 +00:00
7a3dd45372 mod_tile: Fix thread safety for running in multithreaded Apache (MPM Worker). Should prevent the build up of hung processes. 2008-03-12 23:03:29 +00:00
a16d3b730f mod_tile: Update render config settings with those used by tile. Add delay on out-of-bounds access to rate limit clients which just loop forever even though we send them an error 2008-03-12 21:52:41 +00:00
df6acfc6ae mod_tile: move to middle translate name hook since we want to give mod_rewrite a chance to update the name 2008-02-16 21:26:38 +00:00
923337038c mod_tile: Update to a new meta tile scheme which stores all sub-tiles in a single .meta file. The PNG files are extracted from this on the fly by mod_tile. This is more efficient in disk space and inode usage 2008-02-16 20:30:49 +00:00
850ba850a1 mod_tile: Fix expiry header. Update output of /status and /dirty 2008-02-02 20:46:27 +00:00
bd103c462b mod_tile: if rendering fails but we have an old tile, return that instead of an error 2008-01-30 19:40:49 +00:00
060498b387 mod_tile: Implement meta-tiles. Add speed test and tool to allow bulk rendering of tile list from stdin 2008-01-23 20:49:40 +00:00
bfeb102662 mod_tile: Implement directory hashing. Improve reconnection between mod_tile and renderer. Use new Mapnik native code for cutting and saving the tiles in 256 colours. Removes ImageMagick dependency. 2008-01-20 17:42:58 +00:00
cd9801bc1e mod_tile: Apache module and rendering daemon for serving OSM tiles 2007-10-12 21:18:59 +00:00