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

I am thinking of hosting my own tile server for OSM but I am a bit confused about what kind of server I would need.

There are several questions about what you need but it never says anything about the load such a server could handle and since the load isn't small I am worried it won't be enough.

Right now we are using Google Maps which has a 100k uses a month and expected is that the average use would need around 40-60 tiles.

Right now we only want to do a single country and I'm mostly worried about RAM and CPU requirements.

asked 13 Nov '18, 12:27

Joost67's gravatar image

Joost67
11112
accept rate: 0%


There are essentially two bits to a tile server** - there's generating the tiles in the first place, and there's serving those tiles out to users. I'll take this as an example since it's a server that I set up. When a user tries to view a tile that does not exist such as this one a request to render it occurs, and in this case it (and a series of surrounding tiles) took 1.5 seconds to render. This information is in the syslog of the server:

DONE TILE ajt 13 4096-4103 2664-2671 in 1.524 seconds

The next time someone tries to view that tile it doesn't need to be rendered again because it already exists. The existing tile can just be sent out to all the new requests. Only when that tile is quite old, or the rendering system knows that new data from OSM means that that tile is out of date will a new tile be rendered. This means that many of the "100k uses a month of 40-60 tiles" (on average 1 every 2 seconds?) might not cause rendering requests each time - in fact most probably wouldn't - the web server would already have the data to send and no new rendering would take place.

The size of server you'll need for "a single country" depends on the size of the country. Have a look at Geofabrik for how big your country is. The server I'm using as an example has the British Isles loaded, which is about 1.1Gb of input data. That data comfortably fits on a server (cloud or local) with 4Gb memory and 100Gb disk (until a month ago it was on a CX30 at Hetzner; it's now moved to a slightly faster CX41 there). Other cloud providers are available and may be better for you depending on all sorts of factors such as where you're located and where you're serving data to. In my case zoom levels up to 12 are pre-rendered; the job runs once a day and each of these tiles are rerendered once every 4 days. Other higher zoom levels (up to 24 in my case) are rendered only as needed. The database size for 1.1Gb of input data is a little over 30Gb currently.

How much oomph your server needs will also depend on:

  • Whether you need to update the data once loaded
  • How much detail you want to display
  • How many zoom levels you want to display
  • What other functions you want the server to support (mine isn't doing routing or geocoding, for example)

** for the avoidance of doubt I'm assuming you're talking about similar technology to https://openstreetmap.org here. Other technologies are available, but let's keep the answer simple for now.

permanent link

answered 13 Nov '18, 20:02

SomeoneElse's gravatar image

SomeoneElse ♦
36.9k71370866
accept rate: 16%

edited 13 Nov '18, 20:05

Thank you for you comprehensive reply and I think I have gotten a lot futher. Just out of curiosity can I ask what kind of trafic your server is handling? PS: I am going to do the Netherlands which should be only a little smaller than the British Isles

(22 Nov '18, 08:10) Joost67
Your answer
toggle preview

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:

×204

question asked: 13 Nov '18, 12:27

question was seen: 3,430 times

last updated: 22 Nov '18, 08:10

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