OpenTopoMap icon indicating copy to clipboard operation
OpenTopoMap copied to clipboard

opentopomap.org frequently down

Open megies opened this issue 6 years ago • 39 comments

I've recently switched some of our services to use opentopomap.org for map backgrounds. Unfortunately, it turns out that opentopomap.org is quite frequently down. Are there any problems with the web hosting that the website maintainers are not aware of? Is there a chance to fix the website availability percentage?

EDIT: Stability has been real good from August 2019 as of January 2020

CC @jwassermann @egdorf

megies avatar Feb 22 '19 10:02 megies

I also use Opentopomap for a project (in development) and try to conquer the outages with excessive caching on my side (with Mapproxy & Nginx). Are there any mirrors or other public Opentopomap server available?

How complicated/easy is it to setup a server? Is there a docker image / buildfile available yet? How much HD space is required?

I would love to run an additional server if the installation is not that much of a pain. For 15-30 € a month I could rent a server with a lot HD space and enough power. Maybe if 2 or 3 people can contribute 5 to 10 € a month for a reliable service that would be great.

Anyone interested?

lukey78 avatar Mar 03 '19 16:03 lukey78

Hi,

Are there any mirrors or other public Opentopomap server available?

None that I know of (yet !)

How complicated/easy is it to setup a server?

Solid linux knowleges are required The howto is here : https://github.com/der-stefan/OpenTopoMap/tree/master/mapnik

Is there a docker image / buildfile available yet?

Don't think so

How much HD space is required?

1 TB SSD for planet wide is a minimum

For 15-30 € a month I could rent a server with a lot HD space and enough power.

I doubt that'd be enough (unless you know some really low cost provider !) if you are interested in planet wide, regular (less than an hour) updates and are going for a bit of tiles served, 4 cores+32GB RAM is needed

sletuffe avatar Mar 05 '19 15:03 sletuffe

The server just depends on how many people are willing to contribute a small amount. There are server providers in Germany where you can get a good enough server. But of course I don't know about the load, and load balancing could be done with the official Opentopo servers. Currently I think the a/b/c servers are all the same, at least it's the same IP, and if one is down, all seem to be down. I too don't think that so many people use Opentopomap yet.

I think I can install this thing and create a docker image. At least I'd try to if some people are interested.

When there's a docker image available, even more people would be able to just spin up a server. I did that recently with my own mirror of the OSM Overpass API.

lukey78 avatar Mar 05 '19 19:03 lukey78

Maybe whatever consortium/construct is hosting openstreetmap could be asked?

megies avatar Mar 06 '19 12:03 megies

The consortium/construct is just me. The server is a dedicated machine at the University of Erlangen-Nuremberg and is quite powerful (64 GB RAM, 1.1TB SSD for postgresql database, 3 TB HDD for rendered tiles). In the last month 11 TB tiles were served, so the load is quite heavy. Since I currently don't have the free time due to job/family, the server sometimes is unsupervised for weeks and I am happy that it still runs ok. Running an own OTM render server is not that simple (and requires a respective hardware). But if somebody wants to run a tile mirror server (synchronized with our main renderer), this would be great and reduce downtimes, if clients try a|b|c.tile.opentopomap.org accordingly.

der-stefan avatar Mar 06 '19 13:03 der-stefan

@der-stefan Do I understand you correctly, is it possible to "just" mirror the generated tiles from your server (maybe through an rsync job) and serve them through some service? Maybe that'd be the simpler solution, and would need much less CPU and memory, but enough HD space.

Are all the tiles already rendered, or are they rendered on request?

lukey78 avatar Mar 06 '19 14:03 lukey78

The consortium/construct is just me.

Yeah, that's what I guessed already. I was on about the OSM construct and if it might be worth a thought to let them do the hosting, since it's quite a strain, but I have no idea about how that's organised and all..

megies avatar Mar 06 '19 14:03 megies

@lukey78 The tiles are served from the cache and rendered, if they are missing on HDD. A few years ago, the database was synchronized with OpenStreetMap every minute ("minutely diffs") - old tiles were re-rendered and if the rendering took too long, the old cached tile was delivered. Since the OSM planet file consumes too much space nowadays, minutely diffs are not enabled anymore. I occasionally re-import the full planet file (requires 3-5 days).

Tirex has a built in feature to synchronize tile mirrors. I never tried it out, but am willing to, if someone organizes and operates a tile mirror server. :-)

der-stefan avatar Mar 06 '19 15:03 der-stefan

@der-stefan Is "Tirex" this one: https://t-rex.tileserver.ch/ ? Do you think it's possible to try a relatively quick proof of concept, maybe by mirroring only a specific region/country? Then I'd be in to try. If the POC proofs that it's working, we can think about getting some people to invest in a server.

lukey78 avatar Mar 06 '19 15:03 lukey78

For tirex see https://github.com/openstreetmap/tirex and https://wiki.openstreetmap.org/wiki/Tirex

hottrails avatar Mar 06 '19 17:03 hottrails

Another very easy solution would be to setup a public caching proxy server (e.g. nginx or squid) with the current opentopomap server as a backend. Caching time could be defined as well as max hd usage, there's automatic fallback to the upstream if a tile is not available in the cache, and setup is very easy.

It'd of course take some time to fill the cache, but maybe this can be automated by some scripts.

A caching server like this just needs a big HD, but not so much memory and CPU, and you can setup a lot of them in a short time.

What do you think? Am I completely wrong? Tiles are served by Opentopomap with specific URIs and a simple HTTP GET request. So this should work.

lukey78 avatar Mar 06 '19 17:03 lukey78

3 caching servers for a/b/c in front of the current backend server would reduce the load significantly and could act as fallbacks for an outage of the backend.

lukey78 avatar Mar 06 '19 18:03 lukey78

The a.tile server could be the render server itself, only b.tile and c.tile could be external tile cache servers. For worldwide coverage (zoom 1...17), 3TB, >100 MBit/s uplink and unlimited traffic (~1...10TB/month) should be available.

der-stefan avatar Mar 06 '19 21:03 der-stefan

Ok. A caching proxy server (no rendering by itself) with 3-4 TB HD and good uplink would start at about 60 € / month or 720 € / year.

@der-stefan Would it be OK for you if I'd start a crowdfunding campaign in Germany and international to raise some money for server operation for 1/2 years? If enough people contribute, I'd operate, install and monitor the server(s). I'd also invest a good amount by myself if I'd make some money with my websites -- unfortunately that's not the case yet :-)

lukey78 avatar Mar 07 '19 07:03 lukey78

All that fallow is my humble opinion with the few experience I have operating a tile server https://wiki.openstreetmap.org/wiki/Hiking/mri

You'r obviously free to choose the cache/CDN path if you like,

And it's sexy and all because any squid or varnish with 1 or 2 days work will do along with a rather cheap server, but it won't solve your problem imho. Worst, it will add another point of failure + consume time that might much better be invested elsewhere : Like, in a rendering failover/load balancer ;-)

Any problem related to load on a osm2pgsql/postgres/mapnik/renderd/mod_tile rendering infrastructure is not at the tile delivery step but at the tile generation step with renderd+postgresql eating up all the ressources. The mod_tile reading and http sending process is almost negligible in this setup. At best you will have a caching backup failover with missing 404 tiles at random making user experience crappy. But you will unlikely offload the tile server.

Given the tile.openstreetmap.org history, even if I can only guess the reasons, they first choose a caching cdn strategy, but my guess is it was to reduce bandwidth at first. And when they discovered the load and queue length did not budge, they added new rendering nodes.

That beeing said, I don't have a solution to offer now to build/operate that failover worldwide rendering server. But it's been a few month that I've been looking at the opentopomap style to replace my own with a few custom additions. But my target is not and cannot be (lack of SSD) planet wide+minute updates but only Europe.

sletuffe avatar Mar 07 '19 11:03 sletuffe

The biggest problem at the moment is the single point of failure, and actually the server isn't available at some times. Of course you can offload that risk by adding caching proxies. In the worst case they can't deliver some tiles because they are not cached. And no, there's not another point of failure, because you as a user should also implement your own load balancing to the a/b/c servers if you want to benefit from the failover capabilities. At the moment you don't have that option because a, b, and c are the same server.

No one said that the server load is a problem.

lukey78 avatar Mar 07 '19 12:03 lukey78

Ah... no one? I really like to have a reliable mapping service with free topographic maps. Opentopomap is great for that, and I'm willing to contribute even money for this, but I can't afford the whole server.

Actually, I also tried some seeding to fill my own proxy with one country, but of course the official server seems to be rate limited. So, without the help of the server operator it's not possible to setup a separate caching server.

Maybe we can find a solution for that. I won't give up on this.

lukey78 avatar Mar 10 '19 20:03 lukey78

@lukey78 That's quite normal, we won't find too many people who invest the necessary time and money... Fortunately, voluntary service is still widespread in the real world (not the internet). I had to accept that after starting the OTM - but sometimes the right person steps in after years! :-)

der-stefan avatar Mar 28 '19 22:03 der-stefan

Sadly, I didn't receive any reply, even by personal mails, from the OpenTopomap team. At the moment the server seems to be quite loaded, I often run into timeouts with my application. I try to cache the tiles on my server but the implemented rate limiting is blocking me all the time because all requests then come from the same IP.

It seems I have no other chance than trying to setup my own Opentopo server because I really need a reliable service and I think the generated maps from this project are the best topographic maps from free sources that you can get - all the other commercial alternatives are not that great.

I'll start soon and try go the docker way. Once we have a docker file to setup a full server it'd be MUCH easier for other contributors to setup their own server, or even setup new public servers.

For failover, I'd still offer to create a caching tile mirror, because that'd be really simple and not that expensive. But that'd be only possible, too, if the server operator of opentopomap.org removes the rate limiting for the mirror.

If someone wants to help or contribute in any way: Please contact me. Thanks.

lukey78 avatar May 13 '19 19:05 lukey78

Hi lukey78,

if we find out how the parameter sync_to_host in tirex.conf works, we could easily add a tile mirror. See https://wiki.openstreetmap.org/wiki/Tirex/Config.

If you give me a SSH login for scp-ing the currently rendered tiles, I would copy all of them to your server right now.

der-stefan avatar May 13 '19 21:05 der-stefan

Thanks, coming back to you.

The problem at the moment is the large HDD requirement (3 TB) for a full mirror - and I guess most of the tiles are never requested because they belong to parts of the world where no one is going to, or are just water :-).

A server with such a large disk is about 100 € / month, and I can't afford that alone :-(. With another 8-9 users willing to pay each 10€/month for the mirror, I'd happily operate the server.

lukey78 avatar May 14 '19 06:05 lukey78

I also use Opentopomap for a project (in development) and try to conquer the outages with excessive caching on my side (with Mapproxy & Nginx).

I'm afraid this is not about contributing to your server, but would you mind sharing your mapproxy configuration file? I'd also like to set my local proxy, so to spare as much bandwidth as possible from the official server. Many thanks if you won't mind sharing. Cheers!

febs avatar May 21 '19 15:05 febs

A server with such a large disk is about 100 € / month, and I can't afford that alone :-(. With another 8-9 users willing to pay each 10€/month for the mirror, I'd happily operate the server.

@lukey78 Well, don't know if they are given yet, but the OpenStreetMap Operations team recently had 4 retired dual six core servers on offer:

https://twitter.com/OSM_Tech/status/1125676280840630273

No 3TB disks, but at least you'd have some hardware to work and start with for free (at least, that is what I am guessing from the post). OTM might be a nice second life ;-)

mboeringa avatar May 22 '19 08:05 mboeringa

No 3TB disks, but at least you'd have some hardware to work and start with for free

@mboeringa Thanks for the link, but that wouldn't help much. Even if you have servers you still need a datacenter to operate them, and then you're fully responsible for the hardware and you need to have it near you to be able to actually go there for maintenance. I'd never ever again operate my own hardware in a world where hardware becomes less important with each day passing :-)

lukey78 avatar May 22 '19 20:05 lukey78

Firstly a big thanks to Stefan for such a great tile set. The renderer has been down for several days again, not sure if Stefan is aware of it. Also, I've been trying to accumulate as many cached tiles as possible however my server keeps getting throttled so can only get 1 tile per second.

crispe avatar Sep 04 '19 21:09 crispe

There is a modtile config for not throttling proxies: ModTileEnableTileThrottlingXForward

0 - don't use X-Forward-For and allways use the IP that apache sees 1 - use the client IP address, i.e. the first entry in the X-Forwarded-For list. This works through a cascade of proxies. However, as the X-Forwarded-For is written by the client this is open to manipulation and can be used to circumvent the throttling 2 - use the last specified IP in the X-Forwarded-For list. If you know all requests come through a reverse proxy that adds an X-Forwarded-For header, you can trust this IP to be the IP the reverse proxy saw for the request

yvecai avatar Oct 13 '19 14:10 yvecai

Hi there,

As said up there, I'm also a big fan of the OTM rendering and using it on a project as an alternative rendering. (Main one being https://wiki.openstreetmap.org/wiki/Hiking/mri )

Having a backup service to fail over to would be nice for me... so I've done it ! Here it is : https://maps.refuges.info/?layers=0B

But it's far from perfect and unlikely as is to fit for a load balancer of the main OTM server. The main reason being that the server is not beefy enough. (I'm lacking SSD/NVME drives which almost are a "must have" for such a setup.) But I'll be glad to move to a more powerful server if a solution of availability arise (who knows, there might be an happy donator to fund a public OTM load balancing server in the room !).

As of now, it can be used as is with this usage policy https://wiki.openstreetmap.org/wiki/Hiking/mri#Usage_policy but more likely in a slow, last resort "fail over" to the more powerful OTM server.

Beside the server, the current solution for updating the OSM datas is also of concern because it is a long process and is to be improved in the scripts to avoid downtime (using temporary tables for both low and high zoom tables ?)

In the long term, I'll be happy to add a few improvements to the style as well.

For devs, here is the repo of my changes : https://github.com/RefugesInfo/OpenTopoMap/tree/sly-version Note that I'm using Tirex instead of renderd shown in the README

And I'll add a big thanks to @yvecai who sent me a copy of Digital Elevation Model files + hillshaded terrain + contours lines for several Gigabytes

I'll also be happy to share tools, ideas and tips to improve performances or availability with others operating an OTM rendering service. Like how to compute peak dominance or saddle orientation in less than 30 hours... How to improve holes in the DEM : https://opentopomap.org/#map=13/63.04862/11.92223

sletuffe avatar Jan 21 '20 10:01 sletuffe

As a side note, I noticed that the main opentopomap.org has very much improved in stability since last August. Since then, downtimes have been very few. Thanks @der-stefan!

megies avatar Jan 21 '20 11:01 megies

If mirrors are needed, I've made a quick Docker image with a fork of Cyclestreets Tilecache that allows hosting an OpenTopoMap mirror with maps.refuges.info fallback with just two commands.

If there's a definite statement that such a mirror would help, I'll look into hosting one myself and we'll see if I can sustain it financially.

gjedeer avatar Aug 05 '20 10:08 gjedeer

Hi, Looks like tile downloading from OTM is very slow those last days. Is there some temporary problem ?

And among all those docker rendering project, new installation, is there some publicly active mirror ?

sletuffe avatar Feb 01 '23 09:02 sletuffe