Skip to content
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

Protect to avoid process crash in rush #111

Closed
icebob opened this issue Sep 28, 2017 · 1 comment
Closed

Protect to avoid process crash in rush #111

icebob opened this issue Sep 28, 2017 · 1 comment

Comments

@icebob
Copy link
Member

icebob commented Sep 28, 2017

If you start a loadtest and don't wait for responses, the producer creates Promises & collect them while the responses receive. If they don't receive quickly, the producer node starts eating the memory, while reaches the myth 1.4GB RAM and the process crashes.

We need a limit (e.g 50k) in the queue. If the requests reach this limit, throw a QueueIsFullError (retryable) error instead.

Proposal

const broker = new ServiceBroker({
    ...
    transit: {
          maxQueueSize: 50 * 1000, // default value
    }
    ...
});

50k ~ 400MB RAM

@icebob
Copy link
Member Author

icebob commented Oct 3, 2017

Implemented. Released in v0.11.2

@icebob icebob closed this as completed Oct 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant