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

Reduce goroutine storm #4

Open
cryptix opened this issue Jan 19, 2019 · 4 comments
Open

Reduce goroutine storm #4

cryptix opened this issue Jan 19, 2019 · 4 comments

Comments

@cryptix
Copy link
Member

cryptix commented Jan 19, 2019

Right now there is no bound on incoming requests. Each new call starts a goroutine.

Especially for legacy ssb replication this means ~9k once the connection is established. Depending on the load of the remote party this happens in a couple of seconds but I‘ve also Seen strained Systems where this built-up takes nearly 15minutes.

@cryptix
Copy link
Member Author

cryptix commented Jan 19, 2019

One remedy @keks and I thought about is buffering unhandled requests and draining them on a worker pool of static or scalable size.

The idea is to still drain the incoming conn empty as fast as possible. Otherwise we won’t get answers to our calls.

@cryptix
Copy link
Member Author

cryptix commented May 2, 2019

The above approach would stall on live querys. For this to be feasable we need some kind of switchboard that can accumulate live querys and serve multiple muxrpc sessions from a worker.

It would drain the query up to the latest and then hand it over to a live drain of the root log.

@PragmaticCypher
Copy link

What about making a connection limit configurable, and just dropping/rejecting anything which exceeds it?

@cryptix
Copy link
Member Author

cryptix commented Jun 18, 2020

Yup, i thought about a simple token bucket limiter for new calls as well, would be easier to add into the existing code for sure.

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

2 participants