Improving tile rendering performance

Hi all,

I’ve recently set up a tile server using a Postgres/PostGIS DB, mod_tile, renderd, and mapnik. Early tests with a small data set worked well, but once I loaded the entire planet file into the DB, rendering times became very slow. I’ve adjusted my postgres configuration according to various advice on the web, but performance is still too slow most of the time.

Unfortunately, I don’t have much experience administering databases or profiling applications in Linux, so I don’t really know where to begin troubleshooting my problems. I could really use some advice on how to approach this, or at least a point in the right direction.

Additionally, my current hardware is quite limited (for a server): Intel Core-i7 (8 cores), 8 GB ram, a single 500 GB 7200 RPM SATA drive. What sort of performance can I realistically expect to achieve with this setup?

Thanks for any help you can provide.

The fact that the rendering goes fast on a small extract and goes slow once full world imported makes me guess that your bottleneck is the single SATA drive. (My guess is that if your extract was small enough to fit in you 8GB or RAM, then the linux kernel would put every thing in RAM cache, and nullifying the bad speed of the hard drive)

However, you don’t tel us much about what performance du you get :

  • is your server applying minute diffs to keep the database up to date during the rendering of tiles ?
  • do you have figures about the performance you get in rendered tiles per seconds ? at what zoom level ? What rendering style do you use for mapnik ?

Hey sly, thanks for the response. I’ll try to provide some more information:

I’ve tried to minimize how much background work the database is doing. It is not applying any diffs. I performed one vacuum operation manually, then disabled autovacuum.

Currently using the default rendering style that came with mapnik - osm.xml.

Performance seems to be highly dependent on zoom level. Here are some results…

Zoom : Avg Render Time per Tile (seconds)

9 : 3.12
10 : 1.35
11 : 0.434
12 : 0.354
13 : 0.215

So as you can see, rendering is quite slow at low zoom levels. I suspect you’re correct that the single drive is holding things back - judging by the server logs, queries seem to take much longer at lower zoom levels. I also suspect that in some cases, I am getting page thrashing - maybe because the retrieved data is too large to fit in memory all at once?

I found the statistics of the “yevaud” server (the one rendering mapnik@osm.org tiles) here :
http://munin.openstreetmap.org/openstreetmap/yevaud.openstreetmap/renderd_processed.html

On average, it renders between 1 and 5 “metatiles” per second. So if your results are also a in metatiles and not in tiles, then your are not that far with you configuration !
(the default for rendered is a 8x8 metatile of 256px tiles)