Docker Community Forums

Share and learn in the Docker community.

DOCUMENTATION REQUEST: The API is rate limited, but the rate is not documented


(Bradym) #1

Hello,

I’m using the tutum and docker-cloud APIs and getting a 429 response, which the docs tell me means: Too Many Requests – You are being throttled because of too many requests in a short period of time. But it does not say what the threshold is - could you please let me know what your the threshold is so I can adhere to it?

Thanks!


(Borja Burgos) #2

When are you seeing this? Can you provide more information? There is no throttling in Docker Cloud today, this message could be do to too many failed attempts (incorrect token/password). The body should include more specific information. When API throttling is implemented we’ll make sure to document its limits.


(Bradym) #3

I’m currently testing on tutum (haven’t actually tested on docker cloud yet) as we’re still working on the migration plan for moving from tutum to docker cloud. I’ll be using this on docker-cloud as well - unfortunately I have to support both in this tool for now.

The project I’m working on is to create a stack + nodes + services and start them all via the API using a custom CLI. Because I need to our dbs before our other services, I can’t just start the stack as there’s currently no defined order in which services are started.

Because of this I’m looping through the services on the stack and starting them in the order I need them to start.

I’m using the python tutum SDK, here’s the relevant part of the stack trace:

File "/Users/bradym/code/cli/cli/commands/utils.py", line 269, in start_stack_services
  service.start()
File "/Users/bradym/code/cli/venv/lib/python2.7/site-packages/tutum/api/service.py", line 16, in start
  return self._perform_action("start")
File "/Users/bradym/code/cli/venv/lib/python2.7/site-packages/tutum/api/base.py", line 82, in _perform_action
  json = send_request("POST", url, params=params, data=data)
File "/Users/bradym/code/cli/venv/lib/python2.7/site-packages/tutum/api/http.py", line 52, in send_request
  raise TutumApiError("Status %s (%s %s). Response: %s" % (str(status_code), method, url, response.text))
tutum.api.exceptions.TutumApiError: Status 429 (POST https://dashboard.tutum.co/api/v1/service/4a0e393d-ecae-4398-aa2e-ff4852a8b0f4/start/). Response:

Unfortunately the Response is empty - that’s not a copy/paste error.

I’m pretty sure it’s not an auth issue as this is coming back after getting most of the way through the process - at which point nodes and services have been successfully created and started.