derhuerst / db-rest

A clean REST API wrapping around the Deutsche Bahn API.
https://v6.db.transport.rest/
ISC License
86 stars 10 forks source link

problems with availability of hosted version #19

Closed HerrLevin closed 3 years ago

HerrLevin commented 3 years ago

In the last 24h the hosted version at v5.db.transport.rest keeps going offline. Every request (except to the docs) won't return anything, it won't even timeout. My self hosted version works as expected.

derhuerst commented 3 years ago

There were two issues, overlapping:

Because the direkt.bahn.guru postings on Twitter and Reddit went a bit viral, there has been and still is a lot of traffic on the stations search API (v5.db.transport.rest/locations?query=…), the response times are higher than usual. This is due to several factors:

Until yesterday, I had the Caddy load balancer configured to do active health checks against db-rest, which in turn checks if HAFAS by querying departures at some station on the next monday. And, for a reason I don't know, the HAFAS API responds with errors every now and then, which causes the health check to fail, which causes Caddy to take the entire v5.db.transport.rest API offline, responding with 504. I have turned this off temporarily, because with this setup, the benefits (better stability of v5.db.transport.rest itself) are not worth the disadvantages (frequently completely down due to random HAFAS failures).


504s should not appear often anymore, but the overall response time is still high. I'm reluctant to move the APIs to a more powerful server though, because

Regardless, if you want to volunteer running a db-rest instance, you're very much welcome to do so!

derhuerst commented 3 years ago

This is the status page BTW: https://stats.uptimerobot.com/57wNLs39M/784879516

Not sure if the report 10h of 404 downtime were actually an issue. 🤔

derhuerst commented 3 years ago

I'll close this. Please re-open if you have more questions related to this.