NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

Hi all

I have set up my own local OSM server according to http://switch2osm.org/serving-tiles/building-a-tile-server-from-packages on my Kubuntu 12.04 system. It works great, how ever I am a bit disappointed about the rendering speed. Even when I use it on the same PC, the tiles are rendered and loaded in the browser quite slow.

I would like to figure out where the boddle neck is. None of the CPU cores (4 cores, Intel Core i5 2500K) is at 100%. Also the RAM (4 GB) is not at its limit. I use a SSD as hard drive for the system and tile store.

Once the tiles are rendered and served from the cache, it is as fast as I would expect it to be normally.

How can I see the work load of the apache2, renderd or postgresql service? I could not find any usful log file in /var/log/.

asked 16 Oct '12, 18:30

CaCO3's gravatar image

CaCO3
31113
accept rate: 0%


Most likely the bottleneck is the database. There's a PostgreSQL config option called log_min_statement that you can use to log all database statements taking longer than a given amount of time, then investigate. You'll either find that each tile makes a lot of slow queries (which would point to general database slowness), or you might find that one specific query is always the culprit (in that case, creating a specific index might help).

Yo do have the database on the SSD, right?

It is absolutely normal for tiles on the lower zoom levels, up to z13 or z14, to take longer than the user is prepared to wait; that's why these are usually rendered in advance (a.k.a. "seeding" of the tile cache).

permanent link

answered 16 Oct '12, 19:58

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
82.5k927201273
accept rate: 23%

1

Thank you for your quick reply.

My database is on the SSD (my whole system is on it). My main usage will be on zoom level 18, so prerendering is not an option. I will have a look on the postgreSQL config. Since I am not planing to update the database frequently, I dropped the --slim parameter on the osm2postgreSQL import. Also I increased the memory. How ever I understand this is only the memory limit during the import. My command was: osm2pgsql -C 2500 Switzerland.osm.pbf

Over all, I would expect that my server is rendering and serving faster than the public osm server, since my server has enough resources for one country and I am the only user on it.

(17 Oct '12, 08:26) CaCO3

I'd check the postgresql performance too.

But before that, one all-round tool you can use is atop (not top), which tells you about disk utilisation, displays more correct memory usage, and fully tracks processes instead of showing periodic snapshots.

(17 Oct '12, 10:17) Vincent de P... ♦
1

Probably not the issue here, but make sure that you have set the planet-import-complete file. Otherwise mod_tile will try and re-render everything every 3 days, which is unnecessary if you don't update your database.

Otherwise, can you say how slow slow is? Seconds? 10s of seconds or minutes? At which zoom level? Rendering Z18 tiles of a Switzerland only db should probably take < 3 seconds in most cases.

(18 Oct '12, 16:37) apmon

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×105
×33
×1
×1

question asked: 16 Oct '12, 18:30

question was seen: 7,893 times

last updated: 01 May '14, 12:55

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum