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

Shape RPC traffic to prevent DoS from heavy load #1000

Closed
benjamincburns opened this issue May 28, 2020 · 1 comment
Closed

Shape RPC traffic to prevent DoS from heavy load #1000

benjamincburns opened this issue May 28, 2020 · 1 comment
Labels
icebox items that need more consideration, time, or can wait performance TeamChupa GH issues worked on by Chupacabara Team

Comments

@benjamincburns
Copy link

Description

As an person running a Besu node, I want it to rate limit RPC requests when there are lots of pending requests that have not yet completed.

Today it's fairly easy for me to run operations over RPC that cause a node to become bogged down and stop tracking the network head, or worse, to throw OOM exceptions and hang. In enterprise environments it's likely that nodes will be shared across many services/users. In this sort of environment, we don't want a surge in RPC traffic from one user to crash the node or deny service to other users who are keeping their traffic within expected limits.

Acceptance Criteria

  • RPC traffic can be submitted to Besu at any rate and Besu does not crash and does not stop tracking the head of the network.

Steps to Reproduce (Bug)

  1. Spam Besu with a ton of Transactions
    or
  2. Spam Besu with a ton of transaction trace requests
    or
  3. Spam basu with a ton of eth_call requests

(there likely are plenty of other heavy RPC calls that will either cause crashes or cause the node to fall behind)

Expected behavior:
Node returns a rate limiting error response when it is too busy to process incoming RPC messages, or applies back-pressure on the request rte through some other means.

Actual behavior:
Node keeps trying to process RPC requests past the point where it can no longer maintain network state, or until it runs out of memory and hangs without crashing.

Frequency:
I expect in a large scale production environment this will be a common issue.

Recently I've seen this happen on our test nodes when a misconfiguration caused RPC traffic to be sent to a node that wasn't spec'd to handle the load that was being put on it.

I've also caused plenty of nodes to hang while running fixed-rate performance tests with Caliper.

Versions (Add all that apply)

  • Software version: 1.4.X (1.4.5 is current release)
@benjamincburns benjamincburns changed the title Shape RPC traffic to prevent DoS from heavy RPC traffic Shape RPC traffic to prevent DoS from heavy load May 29, 2020
@non-fungible-nelson non-fungible-nelson added the icebox items that need more consideration, time, or can wait label May 24, 2022
@iamhsk iamhsk added the TeamChupa GH issues worked on by Chupacabara Team label Jul 14, 2022
@non-fungible-nelson
Copy link
Contributor

we now limit RPC with this #4965 which is user configurable with some sensible defaults.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
icebox items that need more consideration, time, or can wait performance TeamChupa GH issues worked on by Chupacabara Team
Projects
None yet
Development

No branches or pull requests

4 participants