You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have been hosting the Tiler database on Hetzner for over a month. According to Sanjay’s recommendation, placing both the Tiler server and its database on the same Hetzner instance will improve performance and prevent cross-continental data transmissions. This change is expected to reduce latency, lower data transfer costs, and enhance overall efficiency
changed the title [-]Migrate Tiler Server and Database to the Same Hetzner Instance[/-][+]Migrate Tiler Server to the Hetzner Instance[/+]on Feb 12, 2025
Would the planets and replication diffs continue to be stored in AWS? Do any other services require direct access to the database, or do they all consume the minutely diffs?
Would the planets and replication diffs continue to be stored in AWS?
Yes. The idea is that the main API database continues to be on AWS and continues outputting the minutely diffs to s3.
For anything that only depends on consuming minutely diffs - the tiler, overpass, etc. - it is possible to move to much cheaper infrastructure like Hetzner.
The idea is definitely that the minutely diffs continue to be on AWS - and any services we move to different infrastructure should only have the minutely diffs on s3 as dependency. Hence also this ticket, to move the tiler server over so that the only interface between infra on Hetzner and infra on AWS is the minutely diffs, and we don't have complicated database connection dependencies between infra in different data centers.
Also, if we move tiler-serve to Hetzner, we need to use Redis instead of S3 to store the cache. Currently, the tiler server stores the cache in an S3 bucket, which works because both the tiler server and the bucket are in the same region (us-east-1)
For anything that only depends on consuming minutely diffs - the tiler, overpass, etc. - it is possible to move to much cheaper infrastructure like Hetzner.
This will significantly reduce infrastructure costs in AWS. All services that depend only on the planet dump and minute replication are: Overpass API, Nominatim API, Tiler, and OSMCha. These databases can be easily recreated using those files.
@batpad An important point we need to consider is that we are currently using SQS to handle expired tiles. The workflow to check cached tile files is fully configured with HELM and a cronjobs, Should we do a new configuration for those handlers? or find equivalents to that service in Hetzner,
I have done some testing the hetzner storage for tiler-server, and it works fine. We just need to make some extra configurations in the Tegola config.
Since Hetzner does not support SQS, we can still use AWS SQS to store the expired files and consume those from Hetzner to create the container that will remove the expired tile cache and seed the new cache tiles.
I have deployed the tiler-server along with tiler-imposm, tiler-cache, and tiler-seed (both global and coverage) in Hetzner server, the server is exclusively for production.
The changes include:
We are still using AWS SQS for expired files.
We are now using a Hetzner S3 bucket to store the tiles.
Ingress with the vtiles domain is running with a reverse proxy, forwarding traffic to the Hetzner IP address and port.
The pipeline is built using Docker Compose since it is going to consume fewer resources than Kubernetes.
The changes in Helm include an easy way to revert tiler to AWS if needed.
Activity
[-]Migrate Tiler Server and Database to the Same Hetzner Instance[/-][+]Migrate Tiler Server to the Hetzner Instance[/+]1ec5 commentedon Feb 12, 2025
Would the planets and replication diffs continue to be stored in AWS? Do any other services require direct access to the database, or do they all consume the minutely diffs?
batpad commentedon Feb 13, 2025
Yes. The idea is that the main API database continues to be on AWS and continues outputting the minutely diffs to s3.
For anything that only depends on consuming minutely diffs - the tiler, overpass, etc. - it is possible to move to much cheaper infrastructure like Hetzner.
The idea is definitely that the minutely diffs continue to be on AWS - and any services we move to different infrastructure should only have the minutely diffs on s3 as dependency. Hence also this ticket, to move the tiler server over so that the only interface between infra on Hetzner and infra on AWS is the minutely diffs, and we don't have complicated database connection dependencies between infra in different data centers.
Rub21 commentedon Feb 13, 2025
Also, if we move tiler-serve to Hetzner, we need to use Redis instead of S3 to store the cache. Currently, the tiler server stores the cache in an S3 bucket, which works because both the tiler server and the bucket are in the same region (us-east-1)
batpad commentedon Feb 13, 2025
@Rub21 ah I see - makes sense. We can also take a look at the Hetzner cloud storage, which is an s3 compatible storage from Hetzner: https://www.hetzner.com/storage/object-storage/ - that maybe easier to move over to for the cache.
Rub21 commentedon Feb 13, 2025
This will significantly reduce infrastructure costs in AWS. All services that depend only on the planet dump and minute replication are: Overpass API, Nominatim API, Tiler, and OSMCha. These databases can be easily recreated using those files.
Rub21 commentedon Feb 13, 2025
This is quite good, and we can just same Tegola config !!
Rub21 commentedon Feb 13, 2025
@batpad An important point we need to consider is that we are currently using SQS to handle expired tiles. The workflow to check cached tile files is fully configured with HELM and a cronjobs, Should we do a new configuration for those handlers? or find equivalents to that service in Hetzner,
Rub21 commentedon Feb 13, 2025
I have done some testing the hetzner storage for tiler-server, and it works fine. We just need to make some extra configurations in the Tegola config.
Since Hetzner does not support SQS, we can still use AWS SQS to store the expired files and consume those from Hetzner to create the container that will remove the expired tile cache and seed the new cache tiles.
Rub21 commentedon Feb 28, 2025
I have deployed the tiler-server along with tiler-imposm, tiler-cache, and tiler-seed (both global and coverage) in Hetzner server, the server is exclusively for production.
The changes include:
Rub21 commentedon Mar 11, 2025
Done!