OSM, Valhalla and Curvature server

Good morning everyone :slight_smile:

I would like to set up my own OSM server, along with Valhalla and Curvature.
PBF for Europe.
The server will be needed for displaying maps and routing in the application.
What are the minimum hardware requirements for the infrastructure to make sense?
I’m interested in fast performance on the application side, while data loading into the database can be slower.
I was considering Google Cloud where I would set up a virtual machine and a database server separately, but I’m not sure what components I need (CPU, RAM, disk capacity).
I was thinking of 800GB for the database, with 4xCPU and about 30GB of RAM, but I’m unsure if that might be too much to start with.
Initially, I’d like to support 1000 users with potential for growth later.
I assume that with 1000 users, I won’t be able to use the free API? :slight_smile:

I think some information is missing to give precise advice, but I would definitely recommend starting small by choosing a small European country to get familiar with
(for example, Portugal or Austria).

For a map server, I would suggest using Protomaps:

For Valhalla, I recommend this Dockerized solution:

If your clients are also in Europe, I believe it would be cheaper to rent a private server from Hetzner than to use Google Cloud:

But I think you can start exploring on a more powerful laptop as well (≥ 16GB RAM).

Accurately scaling for 1,000 users is very difficult since it’s unclear how many of them will be concurrent users and what type of Valhalla API calls are expected. It’s also unknown how often the maps need to be updated—hourly, daily, or monthly.

However, I would estimate that 8 cores and 64 GB of RAM should suffice for 1,000 users, allowing for 16 concurrent API calls. Although the memory might seem excessive, it’s important to have some reserve, especially if you need to generate new Valhalla map data for weekly updates.
Of course, it might be possible to start exploring with 32 GB of RAM and 4 CPU cores.

And good luck with your exploration!

2 Likes

Hey,
Thanks for answer :slight_smile:

I need to set up a Tail server so that it works with navigation on a mobile device for my client. Can you recommend any reliable solutions or a working Docker container for this purpose?

Is “Tail” ~= “tile server”?

More information is needed:

  • Is the “tile” needed for navigation(routing) or as a background map?
  • How frequent should the openstreetmap data updates be? If annual updates are sufficient, that’s much simpler, but if hourly updates are needed, it’s much more complex.
  • What exactly is the “mobile device”? And would raster or vector tiles be ideal? For example, displaying vector map tiles requires a stronger CPU in the mobile device.

Currently, “vector tiles” are the best practice.
there are multiple tile schema

for example - shortbread with tilemaker
https://pka.github.io/customizing-shortbread-vector-tiles/#/shortbread-with-tilemaker

git clone https://github.com/shortbread-tiles/shortbread-tilemaker
cd shortbread-tilemaker

# Download additional data (water polygons, etc.). Requires ogr2ogr!
./get-shapefiles.sh

# Download OSM extract
curl -sSfO --output-dir data https://download.geofabrik.de/europe/liechtenstein-latest.osm.pbf

docker run --rm -v $PWD:/var/tm -w /var/tm versatiles/versatiles-tilemaker \
  tilemaker --config config.json --process process.lua \
            --input data/liechtenstein-latest.osm.pbf --output data/shortbread.pmtiles

Shortbread with Planetiler

docker run --rm --user=$UID -v $PWD/data:/data ghcr.io/onthegomap/planetiler shortbread.yml \
  --download --area=liechtenstein --output=/data/shortbread.pmtiles

etc.

2 Likes

Hello,

Yes, I meant tails, my mistake :slight_smile:

I was thinking about monthly updates to keep the maps current, but from what I’ve read, OSM offers files with only the changes.
For route planning, I wanted to use Valhalla and Curvature, so I would need tails to display the map.

As for raster or vector, I’m not sure, but it should work on different devices since we have a mix of Android and iOS in the company.
I wanted to set everything up in Docker, so it can be easily moved to another server or replicated and used with a load balancer if needed.

How does address and POI search work? Right now, in tests, I’m using Nominatim, but I’d like to set that up on the server as well. Do addresses and POIs come with the tails server?

Is there anywhere a historical traffic database available?

Sorry for my noob questions, but I’m slowly giving up after going through so many non-working instructions on the internet :smiley:

see

In addition to Nominatim, there are other alternatives as well, which you can find here: Geocoding - OpenStreetMap Wiki

Since you’ve mentioned Android/iOS, it’s worth checking out https://maplibre.org/

  • MapLibre GL JS
  • MapLibre Native

Within the OpenStreetMap project, I’m not aware of a historical traffic database. It’s possible that such data would need to be purchased from a commercial provider.

If your company needs commercial consulting services, please see:
Commercial OSM Software and Services - OpenStreetMap Wiki ( search: routing )

If your company can later support the OpenStreetMap project with data, tracks, corrections, or anything else, please keep us in mind.

1 Like

Thank you very much for your help; I will be testing it shortly :slight_smile:
As for support, we would be more than happy to contribute to OSM because it’s a great initiative!
We can also support it with data, such as traffic information, as much as possible :slight_smile:

1 Like

I have one more question :slight_smile:

The entire infrastructure will be on Hetzner servers. I’m considering the server setup for Europe and came up with the following plan:

  • Valhalla and Curvature - one AX42 server,
  • Nominatim - one AX42 server,
  • Map-related data - one AX42 server,
  • Load balancer, Node, Webpage, user data and files, data updates on other servers, and other minor tasks - one AX42 server.

In total, four AX42 servers.

I’ve read and tried to find information related to the technical requirements for each solution, and it seems like this setup should be sufficient. I plan to run everything on Docker, so if needed, I can replicate these servers.

My question is, do you think this setup will be adequate?

When I finish setting up this project, I’ll also share my experiences here so that it can help others in the future :slight_smile:

I don’t have experience with all the listed programs, but for testing, I would only order one dedicated machine and use it to run all the Docker scripts.
This way, You can assess whether the memory and disk space are sufficient for processing and querying, and identify where the bottlenecks are.

It’s worth noting that the AX42 machine only has 512GB of disk space by default (due to RAID1 mirror), which could be limited in some cases, especially since OpenStreetMap data is continuously growing.

For Nominatim, a year ago, 64GB of RAM and 400GB of disk space were recommended for Europe, so you should definitely be prepared for potential issues there. Other services might also encounter problems, so thorough testing is necessary.