Skip to content

Add concurrency limits and a request queue #8

Open
@jjavery

Description

Currently there isn't a limit to the number of concurrent requests. 10,000 concurrent requests to 2 workers results in 5,000 concurrent requests per worker, which may be a problem (too much memory/cpu/io). If a WorkerPool consumer is already queueing work and limiting concurrent requests, then this problem won't arise. For consumers that don't queue work, it would be useful for WorkerPool to provide this feature.

new WorkerPool({ concurrency }) to set a global limit on concurrent requests?
Thought about setting a per-worker limit but this can be handled by setting a global limit and using a 'fewest' or 'fill' strategy
Optionally limit request queue length and throw exception when attempting to add to queue over length

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions