28 Commits

Author SHA1 Message Date
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