Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Cyborg)
  • No Skin
Collapse
Brand Logo

CIRCLE WITH A DOT

  1. Home
  2. Uncategorized
  3. #ActivityPub developers only: do you implement rate limit support in your HTTP client implementation?

#ActivityPub developers only: do you implement rate limit support in your HTTP client implementation?

Scheduled Pinned Locked Moved Uncategorized
activitypubevanpollpoll
1 Cross-posts 28 Posts 5 Posters 0 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • evan@cosocial.caE This user is from outside of this forum
    evan@cosocial.caE This user is from outside of this forum
    evan@cosocial.ca
    wrote last edited by
    #1

    #ActivityPub developers only: do you implement rate limit support in your HTTP client implementation?

    #EvanPoll #poll

    julian@activitypub.spaceJ spraoi@tooting.chS citc@zotum.netC evan@cosocial.caE 4 Replies Last reply
    2
    0
    • R relay@relay.an.exchange shared this topic
      nodebb@fosstodon.orgN nodebb@fosstodon.org shared this topic
    • evan@cosocial.caE evan@cosocial.ca

      #ActivityPub developers only: do you implement rate limit support in your HTTP client implementation?

      #EvanPoll #poll

      julian@activitypub.spaceJ This user is from outside of this forum
      julian@activitypub.spaceJ This user is from outside of this forum
      julian@activitypub.space
      wrote last edited by
      #2

      @evan@cosocial.ca I voted no.

      NodeBB as an S2S "client" will make hundreds of calls to backfill a topic. It does this to ensure that a topic loads in a timely manner.

      I will agree its rather selfish behaviour and some form of rate limiting (even a naive one) is likely to come.

      1 Reply Last reply
      1
      0
      • evan@cosocial.caE This user is from outside of this forum
        evan@cosocial.caE This user is from outside of this forum
        evan@cosocial.ca
        wrote last edited by
        #3

        @julian Mastodon sets some pretty strict limits on requests -- what do you do when you get 429 errors?

        julian@activitypub.spaceJ 1 Reply Last reply
        0
        • evan@cosocial.caE evan@cosocial.ca

          @julian Mastodon sets some pretty strict limits on requests -- what do you do when you get 429 errors?

          julian@activitypub.spaceJ This user is from outside of this forum
          julian@activitypub.spaceJ This user is from outside of this forum
          julian@activitypub.space
          wrote last edited by
          #4

          @evan@cosocial.ca if I've been hit by them I've never noticed. It could be that the nature of conversations on the fediverse usually mean NodeBB reaches out to many servers, but the only software I've ever had a problem with is Discourse. It blocks me after 15 requests.

          mcc has a toot thread in the hundreds, and when NodeBB discovered it it backfilled the entire thing.

          When it hits a 429 NodeBB should probably retry after a cooldown period, but it doesn't at the moment. It just marks it as failed.

          1 Reply Last reply
          1
          0
          • evan@cosocial.caE evan@cosocial.ca

            #ActivityPub developers only: do you implement rate limit support in your HTTP client implementation?

            #EvanPoll #poll

            spraoi@tooting.chS This user is from outside of this forum
            spraoi@tooting.chS This user is from outside of this forum
            spraoi@tooting.ch
            wrote last edited by
            #5

            @evan

            Yes but, so far it's a filed issue, not the actual code.

            1 Reply Last reply
            0
            • smallcircles@social.coopS This user is from outside of this forum
              smallcircles@social.coopS This user is from outside of this forum
              smallcircles@social.coop
              wrote last edited by
              #6

              @julian @evan

              Voted "No, but.." against backdrop of #ActivityPub API task force, where issue tracker has an issue on rate limits.

              From perspective of "avoiding misconceptions" I was wondering about a range of issues that have been created, and how they relate to Protocol versus Solution design. See also: https://github.com/swicg/activitypub-api/issues/63

              I think it may be valuable to define different stakeholder roles, to track people's needs. For #Protosocial thus far I discern in order of importance:

              1. Solution developer
              2. Protosocial implementer
              3. Protocol designer

              When asking the question "Should rate limits be part of the protocol?", starting point for design is a firm No.

              Solution devs should not be worried about them. Need for rate limits depends on requirements of individual Protosocial impls, and what their goals are.

              Protocol-level there's actor introspection. There are no "instances" but Application actors that host Services, including system services, that may expose Rate Limit as metadata.

              smallcircles@social.coopS evan@cosocial.caE 2 Replies Last reply
              0
              • smallcircles@social.coopS smallcircles@social.coop

                @julian @evan

                Voted "No, but.." against backdrop of #ActivityPub API task force, where issue tracker has an issue on rate limits.

                From perspective of "avoiding misconceptions" I was wondering about a range of issues that have been created, and how they relate to Protocol versus Solution design. See also: https://github.com/swicg/activitypub-api/issues/63

                I think it may be valuable to define different stakeholder roles, to track people's needs. For #Protosocial thus far I discern in order of importance:

                1. Solution developer
                2. Protosocial implementer
                3. Protocol designer

                When asking the question "Should rate limits be part of the protocol?", starting point for design is a firm No.

                Solution devs should not be worried about them. Need for rate limits depends on requirements of individual Protosocial impls, and what their goals are.

                Protocol-level there's actor introspection. There are no "instances" but Application actors that host Services, including system services, that may expose Rate Limit as metadata.

                smallcircles@social.coopS This user is from outside of this forum
                smallcircles@social.coopS This user is from outside of this forum
                smallcircles@social.coop
                wrote last edited by
                #7

                @julian @evan

                I cross-referenced the poll and my reply to the Rate Limit issue in the tracker..

                Link Preview Image
                Rate limiting · Issue #4 · swicg/activitypub-api

                "As an ActivityPub client developer, I want a reliable and standard way to discover rate limits in an ActivityPub API server, so I can avoid unexpected failures for my users."

                favicon

                GitHub (github.com)

                1 Reply Last reply
                0
                • evan@cosocial.caE evan@cosocial.ca

                  #ActivityPub developers only: do you implement rate limit support in your HTTP client implementation?

                  #EvanPoll #poll

                  citc@zotum.netC This user is from outside of this forum
                  citc@zotum.netC This user is from outside of this forum
                  citc@zotum.net
                  wrote last edited by
                  #8
                  @Evan Prodromou
                  Necessary via hubzilla/streams/forte?
                  evan@cosocial.caE 1 Reply Last reply
                  0
                  • citc@zotum.netC citc@zotum.net
                    @Evan Prodromou
                    Necessary via hubzilla/streams/forte?
                    evan@cosocial.caE This user is from outside of this forum
                    evan@cosocial.caE This user is from outside of this forum
                    evan@cosocial.ca
                    wrote last edited by
                    #9

                    @citc what?

                    1 Reply Last reply
                    1
                    0
                    • R relay@relay.mycrowd.ca shared this topic
                    • smallcircles@social.coopS smallcircles@social.coop

                      @julian @evan

                      Voted "No, but.." against backdrop of #ActivityPub API task force, where issue tracker has an issue on rate limits.

                      From perspective of "avoiding misconceptions" I was wondering about a range of issues that have been created, and how they relate to Protocol versus Solution design. See also: https://github.com/swicg/activitypub-api/issues/63

                      I think it may be valuable to define different stakeholder roles, to track people's needs. For #Protosocial thus far I discern in order of importance:

                      1. Solution developer
                      2. Protosocial implementer
                      3. Protocol designer

                      When asking the question "Should rate limits be part of the protocol?", starting point for design is a firm No.

                      Solution devs should not be worried about them. Need for rate limits depends on requirements of individual Protosocial impls, and what their goals are.

                      Protocol-level there's actor introspection. There are no "instances" but Application actors that host Services, including system services, that may expose Rate Limit as metadata.

                      evan@cosocial.caE This user is from outside of this forum
                      evan@cosocial.caE This user is from outside of this forum
                      evan@cosocial.ca
                      wrote last edited by
                      #10

                      @smallcircles @julian I disagree!

                      Rate limits are a common part of APIs. For apps to work across servers, the servers need to provide about the same interface.

                      Using standard rate-limiting headers lets client apps detect what rate limits they will be held to. It reduces the uncertainty.

                      Fortunately, there is a well known de facto standard and an even better IETF standard coming up. We should point them out.

                      julian@activitypub.spaceJ 1 Reply Last reply
                      1
                      0
                      • evan@cosocial.caE evan@cosocial.ca

                        @smallcircles @julian I disagree!

                        Rate limits are a common part of APIs. For apps to work across servers, the servers need to provide about the same interface.

                        Using standard rate-limiting headers lets client apps detect what rate limits they will be held to. It reduces the uncertainty.

                        Fortunately, there is a well known de facto standard and an even better IETF standard coming up. We should point them out.

                        julian@activitypub.spaceJ This user is from outside of this forum
                        julian@activitypub.spaceJ This user is from outside of this forum
                        julian@activitypub.space
                        wrote last edited by
                        #11

                        @evan@cosocial.ca please do, I am unaware of any standard rate limiting headers...

                        1 Reply Last reply
                        1
                        0
                        • smallcircles@social.coopS This user is from outside of this forum
                          smallcircles@social.coopS This user is from outside of this forum
                          smallcircles@social.coop
                          wrote last edited by
                          #12

                          @evan

                          > Rate limits are a common part of APIs.

                          Yes, of API *implementations*, and they may become part of the public interface of these implementation. Whether they should be part of an open standard protocol specification is a different matter imho. Perhaps in a separate implementation guide, suggesting recommended practices.

                          Or perhaps there may be some way to formulate a generic mechanism in the protocol specification that makes rate limits an extension point, without pinning to a particular method, esp. if it is only a de facto standard.

                          (Other example. The fediverse is still pinned to an expired draft of HTTP signatures.)

                          OTOH if the goal of the task force is to mostly just provide implementation guidance, and maybe a reference impl, then I guess examples of rate limiting may be provided.

                          @julian

                          smallcircles@social.coopS 1 Reply Last reply
                          2
                          0
                          • smallcircles@social.coopS smallcircles@social.coop

                            @evan

                            > Rate limits are a common part of APIs.

                            Yes, of API *implementations*, and they may become part of the public interface of these implementation. Whether they should be part of an open standard protocol specification is a different matter imho. Perhaps in a separate implementation guide, suggesting recommended practices.

                            Or perhaps there may be some way to formulate a generic mechanism in the protocol specification that makes rate limits an extension point, without pinning to a particular method, esp. if it is only a de facto standard.

                            (Other example. The fediverse is still pinned to an expired draft of HTTP signatures.)

                            OTOH if the goal of the task force is to mostly just provide implementation guidance, and maybe a reference impl, then I guess examples of rate limiting may be provided.

                            @julian

                            smallcircles@social.coopS This user is from outside of this forum
                            smallcircles@social.coopS This user is from outside of this forum
                            smallcircles@social.coop
                            wrote last edited by
                            #13

                            @evan @julian

                            For example as far as I am aware XMPP does not dictate how to deal with rate limits, though there's an optional non-final XEP on stream size (which is different). However, Prosody IM does implement rate limiting, explain the confi in their docs.

                            CloudEvents also says nothing about rate limits. But it has a guideline on how to implement Webhooks with HTTP + Websockets. It specifies that 429 Too Many Requests is returned, plus a Retry-After http header. This spec also mentions:

                            > This specification aims to provide such a
                            definition for use with CNCF CloudEvents, but is considered generally
                            usable beyond the scope of CloudEvents.

                            What is nice wrt CloudEvents is how the protocol spec clearly distinguishes various extension points:

                            - adapters
                            - bindings
                            - formats
                            - extensions

                            evan@cosocial.caE 1 Reply Last reply
                            1
                            0
                            • smallcircles@social.coopS smallcircles@social.coop

                              @evan @julian

                              For example as far as I am aware XMPP does not dictate how to deal with rate limits, though there's an optional non-final XEP on stream size (which is different). However, Prosody IM does implement rate limiting, explain the confi in their docs.

                              CloudEvents also says nothing about rate limits. But it has a guideline on how to implement Webhooks with HTTP + Websockets. It specifies that 429 Too Many Requests is returned, plus a Retry-After http header. This spec also mentions:

                              > This specification aims to provide such a
                              definition for use with CNCF CloudEvents, but is considered generally
                              usable beyond the scope of CloudEvents.

                              What is nice wrt CloudEvents is how the protocol spec clearly distinguishes various extension points:

                              - adapters
                              - bindings
                              - formats
                              - extensions

                              evan@cosocial.caE This user is from outside of this forum
                              evan@cosocial.caE This user is from outside of this forum
                              evan@cosocial.ca
                              wrote last edited by
                              #14

                              @smallcircles @julian the point of the API task force is to make using the API across servers possible. That's why we're doing the OAuth work. I think rate limiting is part of the basic profile; it's one of the things you need to support to use the API across different servers.

                              smallcircles@social.coopS 1 Reply Last reply
                              1
                              0
                              • evan@cosocial.caE evan@cosocial.ca

                                @smallcircles @julian the point of the API task force is to make using the API across servers possible. That's why we're doing the OAuth work. I think rate limiting is part of the basic profile; it's one of the things you need to support to use the API across different servers.

                                smallcircles@social.coopS This user is from outside of this forum
                                smallcircles@social.coopS This user is from outside of this forum
                                smallcircles@social.coop
                                wrote last edited by
                                #15

                                @evan @julian

                                For OAuth it is also questionable the extent to which its use should be dictated. For instance in CloudEvents "modeling the security layer" is only facilitated by the protocol spec, another extensibility point.

                                evan@cosocial.caE 1 Reply Last reply
                                0
                                • smallcircles@social.coopS smallcircles@social.coop

                                  @evan @julian

                                  For OAuth it is also questionable the extent to which its use should be dictated. For instance in CloudEvents "modeling the security layer" is only facilitated by the protocol spec, another extensibility point.

                                  evan@cosocial.caE This user is from outside of this forum
                                  evan@cosocial.caE This user is from outside of this forum
                                  evan@cosocial.ca
                                  wrote last edited by
                                  #16

                                  @smallcircles @julian I think we might have different ideas about what the ActivityPub API task force is for.

                                  To me, it's about making it possible for clients to use different servers, and different implementations of the API. That's going to include the social API defined in the ActivityPub standard, but it will also encompass things like rate limits, authentication, caching, CORS, and so on.

                                  How that all gets documented will probably be in one or more community group reports.

                                  smallcircles@social.coopS 1 Reply Last reply
                                  1
                                  0
                                  • evan@cosocial.caE evan@cosocial.ca

                                    @smallcircles @julian I think we might have different ideas about what the ActivityPub API task force is for.

                                    To me, it's about making it possible for clients to use different servers, and different implementations of the API. That's going to include the social API defined in the ActivityPub standard, but it will also encompass things like rate limits, authentication, caching, CORS, and so on.

                                    How that all gets documented will probably be in one or more community group reports.

                                    smallcircles@social.coopS This user is from outside of this forum
                                    smallcircles@social.coopS This user is from outside of this forum
                                    smallcircles@social.coop
                                    wrote last edited by
                                    #17

                                    @evan @julian

                                    The extent to which the default profile becomes a 'straightjacket' impact scope, applicability, and usability. I guess its alright as long as there's sufficient flexibility and extensibility taken into account. Guess the "sufficient" does the heavy lifting here.

                                    evan@cosocial.caE 1 Reply Last reply
                                    1
                                    0
                                    • evan@cosocial.caE This user is from outside of this forum
                                      evan@cosocial.caE This user is from outside of this forum
                                      evan@cosocial.ca
                                      wrote last edited by
                                      #18

                                      @julian There are 3 main clusters.

                                      They're linked here for the ActivityPub API task force, but they also apply for the federation protocol:

                                      Link Preview Image
                                      Rate limiting · Issue #4 · swicg/activitypub-api

                                      "As an ActivityPub client developer, I want a reliable and standard way to discover rate limits in an ActivityPub API server, so I can avoid unexpected failures for my users."

                                      favicon

                                      GitHub (github.com)

                                      evan@cosocial.caE 1 Reply Last reply
                                      0
                                      • evan@cosocial.caE evan@cosocial.ca

                                        @julian There are 3 main clusters.

                                        They're linked here for the ActivityPub API task force, but they also apply for the federation protocol:

                                        Link Preview Image
                                        Rate limiting · Issue #4 · swicg/activitypub-api

                                        "As an ActivityPub client developer, I want a reliable and standard way to discover rate limits in an ActivityPub API server, so I can avoid unexpected failures for my users."

                                        favicon

                                        GitHub (github.com)

                                        evan@cosocial.caE This user is from outside of this forum
                                        evan@cosocial.caE This user is from outside of this forum
                                        evan@cosocial.ca
                                        wrote last edited by
                                        #19

                                        @julian The first is the most standard, `Retry-After`. You get it mostly on `429 Too Many Requests` responses, as a way to tell you when you're next allowed to make a request. Unfortunately, by the time you get it, you're already in the penalty box. It's better to get information on the request quota *before* you get locked out, so you can throttle your requests and avoid getting locked out.

                                        evan@cosocial.caE 1 Reply Last reply
                                        0
                                        • evan@cosocial.caE evan@cosocial.ca

                                          @julian The first is the most standard, `Retry-After`. You get it mostly on `429 Too Many Requests` responses, as a way to tell you when you're next allowed to make a request. Unfortunately, by the time you get it, you're already in the penalty box. It's better to get information on the request quota *before* you get locked out, so you can throttle your requests and avoid getting locked out.

                                          evan@cosocial.caE This user is from outside of this forum
                                          evan@cosocial.caE This user is from outside of this forum
                                          evan@cosocial.ca
                                          wrote last edited by
                                          #20

                                          @julian The second cluster is a de facto standard used for a lot of APIs, with a lot of incompatible variations. The most common pattern is:

                                          X-RateLimit-Remaining: integer, how many requests left in your quota
                                          X-RateLimit-Reset: timestamp, when your quota will reset to full

                                          evan@cosocial.caE 1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups