Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Implement RFC6585 Section-4 for Rate Limiting

#356

Currently the implementation of Rate Limiting returns a 503 Service Unavailable, and as far as I've read from the documentation doesn't provide a "silence" time in the request headers.

Implementing the RFC as described here http://tools.ietf.org/html/rfc6585#section-4, the header returned would look like e.g.

HTTP/1.1 429 Too Many Requests
Retry-After: 3600

If the Retry-After header could then be used to negotiate the "silence" time, which in turn would create an excellent entry point to create some sort of "RetryAfterDelay" plugin.
And in my humble opinion is closer to the specification than using the current 503 status.

Reported by Michael Roterman · February 23rd, 2014 @ 08:31 AM

State: resolved
Milestone: Marvel's Daredevil
Assigned to: Travis Bell Travis Bell

Activity

  1. Travis Bell
    Travis Bell

    Hey Michael,

    Unfortunately this is out of our control currently. The version of Nginx we're on has the 503 hard coded. They didn't improve this until a later version where you can control not only the status but also things like a fully compatible RFC6585.

    We do have plans to eventually upgrade our load balancers/front end HTTP servers but this is not on our immediate list of things to do.

    February 23rd, 2014 @ 10:04 AM

  2. Michael Roterman
    Michael Roterman

    Hi Travis,

    This is unfortunate, however do you think it would be reasonable / possible to implement a "backoff" header to help implementations decide when to retry?

    Thanks!

    February 24th, 2014 @ 05:15 PM

  3. Travis Bell
    Travis Bell

    This has been on the table for a few months as we've been talking about how we're going handle the eventual commercialization of the API (this won't affect developer accounts). We've settled on bringing this in app and outside of the server layer but that also means it's a pretty big job.

    There's a lot more than just some headers that will be useful, we'll have individual control over each API key and improved metrics on our end to make sure we can continue offering our service. It's a necessary step in our evolution, our ops team doesn't like when we have runaway clients (which happens more often than you might think). Thing is, we won't be spending any time on this until we do it all.

    To answer your specific question, no, I don't have an ETA but it will be in the next 6 months.

    February 24th, 2014 @ 05:34 PM

  4. Michael Roterman
    Michael Roterman

    I can understand where you are coming from, as far as I understand the limitation lies at Nginx ( meaning the current version and how you limit-rate the API )?

    I'm not sure if this is possible but, if not through headers could the "backoff" time be included in the response body for time being? Is this limited to the implementation combined with Nginx currently or is that still a part of the API?

    February 24th, 2014 @ 06:04 PM

  5. Travis Bell
    Travis Bell

    Right now, the implementation is purely in Nginx which means we can't do anything without upgrading Nginx itself. This isn't planned in the immediate future.

    February 25th, 2014 @ 01:14 PM

  6. Michael Roterman
    Michael Roterman

    Alright thanks Travis, I'll implement this differently then for time being.

    Did you receive my e-mail by the way?

    February 25th, 2014 @ 03:25 PM

  7. Travis Bell
    Travis Bell
    • State changed from new to started
    • Tag set to feature
    • Milestone changed from Icebox to Magnolia

    March 5th, 2014 @ 04:43 PM

  8. Michael Roterman
    Michael Roterman

    Glad to see this is being worked on! Will implement it within a few days.

    March 5th, 2014 @ 05:53 PM

  9. Travis Bell
    Travis Bell
    • State changed from started to hold

    Work for this has been completed. I'm just waiting for ops to deploy it into production. I'll update this ticket once it is.

    March 18th, 2014 @ 11:02 AM

  10. Michael Roterman
    Michael Roterman

    Hi Travis,

    Been off the radar for a bit, sorry for the delayed update.

    The pull request is waiting for your go-ahead!

    https://github.com/wtfzdotnet/php-tmdb-api/pull/18

    March 24th, 2014 @ 12:48 PM

  11. Michael Roterman
    Michael Roterman

    Hi Travis,

    Been a while since I got back to this ticket, do you have any news on this? The pull request is far by outdated now, and will have to update it accordingly.

    Michael

    September 13th, 2014 @ 01:33 AM

  12. Michael Roterman
    Michael Roterman

    Hi Travis,

    Any update on this yet? I'm about a week away or so from releasing 2.0 and it would be nice to have this implemented?

    Sincerely,

    Michael

    December 18th, 2014 @ 06:16 AM

  13. Travis Bell
    Travis Bell
    • State changed from hold to started
    • Milestone changed from Magnolia to Dawn of the Planet of the Apes

    This has a good chance of getting pushed out in the next week or so. I'll update this ticket and forum post when we do.

    December 21st, 2014 @ 09:36 AM

  14. Michael Roterman
    Michael Roterman

    Would be awesome to include this from 2.0 straight away, I have identified some issues that still need to be resolved on my side and also called upon some collaborators for help and opinions to get work done ASAP. My timeline for 2.0 is roughly 1-2 weeks, I was aiming for a Christmas release but I've had to deal with other personal things.

    If this is going to be implemented by next week I'm pretty sure it's going to be included straight away, instead of making another 2.1 release for it.

    December 21st, 2014 @ 07:10 PM

  15. Travis Bell
    Travis Bell
    • Milestone changed from Dawn of the Planet of the Apes to Jarhead

    January 2nd, 2015 @ 03:16 PM

  16. Travis Bell
    Travis Bell
    • Milestone changed from Jarhead to Fast and Furious

    February 3rd, 2015 @ 08:57 AM

  17. Travis Bell
    Travis Bell
    • Milestone changed from Fast and Furious to Mad Men

    March 9th, 2015 @ 09:29 AM

  18. Travis Bell
    Travis Bell
    • Milestone changed from Mad Men to Marvel's Daredevil

    April 28th, 2015 @ 09:18 AM

  19. Travis Bell
    Travis Bell
    • State changed from started to resolved

    Hey Michael,

    After 15 months, guess what? This is live in production :D

    I'll post about this tomorrow on the Google group but I thought I'd let you know.

    May 19th, 2015 @ 08:18 PM

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.