Skip to content

Migrate Tiler Server to the Hetzner Instance #971

Closed

Description

@Rub21

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

cc. @batpad @danrademacher @1ec5

Activity

  1. self-assigned this
    on Feb 12, 2025
  2. changed the title [-]Migrate Tiler Server and Database to the Same Hetzner Instance[/-] [+]Migrate Tiler Server to the Hetzner Instance[/+] on Feb 12, 2025
  3. 1ec5 commented on Feb 12, 2025

    @1ec5
    Member

    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?

  4. batpad commented on Feb 13, 2025

    @batpad

    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.

  5. Rub21 commented on Feb 13, 2025

    @Rub21
    MemberAuthor

    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)

  6. batpad commented on Feb 13, 2025

    @batpad

    @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.

  7. Rub21 commented on Feb 13, 2025

    @Rub21
    MemberAuthor

    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.

  8. Rub21 commented on Feb 13, 2025

    @Rub21
    MemberAuthor

    which is an s3 compatible storage from

    This is quite good, and we can just same Tegola config !!

  9. Rub21 commented on Feb 13, 2025

    @Rub21
    MemberAuthor

    @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,

  10. Rub21 commented on Feb 13, 2025

    @Rub21
    MemberAuthor

    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.

  11. Rub21 commented on Feb 28, 2025

    @Rub21
    MemberAuthor

    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.
  12. Rub21 commented on Mar 11, 2025

    @Rub21
    MemberAuthor

    Done!

  13. added theissue type on Mar 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions