From OpenStreetMap Wiki
Jump to: navigation, search

Tirex is designed to run on a single host only. This made the design easier and should be enough in most cases. If one host is not enough for your needs there are several strategies possible.

Use a Caching Proxy in Front of Tirex

You can use a caching http proxy such as Squid in front of your tile server. This can take some of the load of the tile server.

Separate Database Server

Typically you need a large database for your map data that is accessed from the Mapnik rendering backend. You can install this database on a different host, taking part of the load off your tile server. But be aware that on a typical OSM tile server huge amounts of data flow between the database and the renderer, so you need a fast network connection between the two hosts.

If you run a setup like this, you might want to look at the PgBouncer, a lightweight PostgreSQL proxy [1].

Splitting The Map

You can use a load balancer or special Javascript code in your OpenLayers map to direct tile requests for different tiles to different servers. This way the load is distributed. Its reasonably easy to do this according to the map and/or zoom level. If you want to split according to the X and Y coordinates, remember that tile rendering and caching is done in metatiles.

Using Tirex Syncd

Tirex comes with a daemon called tirex-syncd. If configured properly, it will run in the background on your tile server and gets notified by the master whenever a metatile was newly rendered. It will then copy this metatile to another host. This can be used to have a backup host in case your primary host fails.

See the Config options in the mail file starting with sync for the configuration needed.

Future Developments

In the future Tirex might be changed to directly support multiple hosts, but there are no concrete plans yet.