New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pooling tasks issue #16
Comments
@zatsepinvl Thanks for your question You can do multiple task per time using worker's var worker = new StepFunctionWorker({
activityArn : '<activity-ARN>',
workerName : 'workerName',
fn : fn,
concurrency : 2 // default is 1
}); You can increase it like 1 worker = multiple pooler = multiple parallel task. 1 pooler = 0 or 1 task Horizontal scaling (parallel tasking) is managed by the worker's poolers numbers (Worker's The word "pooler" come from the concept of long polling which is used to request task from AWS step function. The pooler's role is to ask AWS step-function's activity for a task, but when the task is associated to the pooler, then this pooler is "taken" and this pooler should not call the "pool" method anymore Any suggestion is welcome |
Great explanation, thanks! My issue is about the following case. Imagine that there are about 10k step function executions work at the same time. Every execution includes activity task. Every task handling may wait for a long time for user input (up to activity task timeout). So, if relation of pooler to task is about 1 to 0 or 1, thus actual number of concurrent executions are limited by concurrency configuration of worker. Is it right? What is the maximum value of concurrency? And more generally, can it be implemented as 1 pooler to 0 or n tasks so execution concurrency is limited only by runtime performance capabilities? |
Yes it is right
Each pooler will create an http request so it will be limited by the max number of http request of your environment.
I agree we need to change the design Use case infosI'd like to know more about your use case, step-function-worker is useful when the processing does not "fit" into a lambda function, on my personnal use cases, those processing were cpu-intensive and i cannot run 10k in parallel, so i did use very low concurrency values (1,2,3 max), can you please explain more your use case (do you prefer activity over lambda or do you have a specific reason that makes lambda unusable in your use case ?) ProposalHere is a proposal for new design, please confirm it will fix your concerns Actual
Expected
Next step
|
Use case infosMy use case is about chat-bot. I have step function as description of flow and activity as messages dispatcher. Dispatcher is responsible for listening user messages and responding them back. Process can be described like this: [task] Some question to user to fill in -> [activity] (dispatcher pools task -> send message from tasks to user -> wait for response -> return user response as a result of task). Assuming that chat-bot is used by 1m users, 10k active executions are quite reasonable fact. In this case number of active executions are the number of users that service can process. ProposalExpected design looks appropriate to satisfy my use case. |
Hello @zatsepinvl I have released 3.0 alpha on https://github.com/piercus/step-function-worker/releases/tag/v3.0-alpha. Is it fixing your concerns ? |
Thank you! Looks like appropriate. |
BREAKING CHANGE: this is a breaking change Redesign the concurrency architecture for 3.0 following #16
@zatsepinvl It's been a while, but for information, v3.0 has been released today Thank you for your help on this |
Hi! I have noticed that implementation of Pooler assumes working only with one task per time:
https://github.com/piercus/step-function-worker/blob/master/lib/pooler.js#L71
'pool should not be called when task on going'
What is the reason for such approach?
The text was updated successfully, but these errors were encountered: