-
Notifications
You must be signed in to change notification settings - Fork 58
Starting worker with should_register set to true causes ThrottlingExceptions #82
Comments
Flow could potentially do this in 3 ways -
We currently recommend users to start their workers in a staggered way instead of all at once. You can also request a limit increase from SWF here. |
Can't you fetch all the known activity types using a single call: |
Domain#activity_types is just a ruby sdk abstraction that sits on top of the SWF client. It calls #list_activity_types internally and pages through all the results to return back the entire list. |
My reading of http://docs.aws.amazon.com/amazonswf/latest/apireference/API_ListActivityTypes.html is that it returns all the types if you don't specify a name. Is that wrong? |
Right, it returns all the types if you don't specify a name. What I meant to say was if the list is large enough, it will make multiple calls to page through the entire list. List is also a slower and potentially more expensive call than Register. It is difficult to predict which one will cost the customers less since it depends on the usage scenario. In our experience, register method seems to come out cheaper. |
But it sounds like each page returns up to 100 types -- so instead of 100 register calls, you'd have a single list call, followed by checking which types are still unregistered and only registering those (and so on for each page). In term of # of calls that seems like a large savings in the typical case (in which a worker restarts and most of the types are already registered). |
We will explore using List before trying to register and look at the cost difference between the two methods. |
We have changed the implementation of the runner to register only using the first worker for each set of workers. This should reduce the number of register calls by a factor of number_of_workers if you are using the runner to start your workers. Closing the issue for now but please feel free to reopen if you think this doesn't solve the issue. Thanks! |
we've already implemented this fix ourselves and unfortunately it doesn't resolve the issue. (i can't reopen since i'm not a collaborator on this repo) |
We have tens of workflow types and hundreds of activity types, which if we try to register on activity/workflow worker startup end up sending one request per type to SWF in rapid succession, causing:
AWS::SimpleWorkflow::Errors::ThrottlingException Rate exceeded
There should be a way to avoid registering already-registered types (which is most of them).
The text was updated successfully, but these errors were encountered: