public-transport / transport.rest

Information about the *.transport.rest APIs.
https://transport.rest/
34 stars 4 forks source link

Frequent 503s since 21 June 2024 (v6.db.transport.rest) #25

Open siracacl opened 2 weeks ago

siracacl commented 2 weeks ago

Hi, wondering if anyone else has the same issue.

Didn't find anything on the status page, so not sure if I am just doing something wrong. I send about 20 requests (e.g. this) every 1 to 2 minutes to the API and have been getting frequent 503s since yesterday. I seem to to get a successful request only every 30 to 60 minutes or so.

Is it possible that I tripped any rate limits? If so, how should the 100 request limit/minute be interpreted? Did anything change?

derhuerst commented 2 weeks ago

Didn't find anything on the status page, so not sure if I am just doing something wrong. I send about 20 requests (e.g. this) every 1 to 2 minutes to the API and have been getting frequent 503s since yesterday. I seem to to get a successful request only every 30 to 60 minutes or so.

20 times the same URL, or different requests? I'm asking because it might be related to the caching logic.

Can you either provide a script that reproduces the error, or provide some details about how you're requesting (from one machine or many, IPv4 vs IPV6, etc)?

Your problem might be related to #20 or to https://github.com/derhuerst/db-rest/issues/39, too.

Is it possible that I tripped any rate limits? If so, how should the 100 request limit/minute be interpreted?

If you exceed the rate limits, you will get 429 responses. The rate-limiting is implemented using the Caddy RussellLuo/caddy-ext/ratelimit extension.

Did anything change?

Nope, nothing changed.

derhuerst commented 2 weeks ago

I have run OS package upgrades, npm package upgrades, and rebooted the system. Maybe that already changes something?

derhuerst commented 2 weeks ago

cc @vidkazan

siracacl commented 2 weeks ago

20 times the same URL, or different requests? I'm asking because it might be related to the caching logic.

about 20 different URLs, from one machine, IPv4

If you exceed the rate limits, you will get 429 responses. The rate-limiting is implemented using the Caddy RussellLuo/caddy-ext/ratelimit extension.

I thought so, but wasn't sure. What I found particularly strange was that I had successful requests about once an hour (around minute 15 to 30) and 503s the rest of the time, which led to me thinking that I might've gone over a limit.

Your problem might be related to https://github.com/public-transport/transport.rest/issues/20 or to https://github.com/derhuerst/db-rest/issues/39, too.

I was aware of the IPv6 situation and this didn't seem to be the cause for my issue; IPv6 requests lead to 504s for me.

At the moment, everything works fine even with requests every minute.

I don't know if and how long requests are logged, but if there are any logs, feel free to look for entries to this, should be somewhat unique in the pile of requests.

vidkazan commented 1 week ago

For some reason that happens every Saturday, as well as today, but not during working days🤔 Now I receive for any request 503 and REDIS errors.

siracacl commented 1 week ago

Seems to work just fine for me at the moment @vidkazan (~15 requests/min)