8000 rpc: lower the memory consumption with fasthttp rpc server by yoomee1313 · Pull Request #1650 · klaytn/klaytn · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Aug 19, 2024. It is now read-only.

rpc: lower the memory consumption with fasthttp rpc server #1650

Merged

Conversation

yoomee1313
Copy link
Contributor
@yoomee1313 yoomee1313 commented Oct 26, 2022

Proposed changes

  • There are many issues which describes the high memory consumption with rpc-serving nodes.
  • I have found one reason about high memory consumption.
  • klaytn code uses valyala fasthttp requesthandler in default for high speed rpc serving. However, it uses its own bytebufferpool library, and it specializes in reuse of memory. I'm not sure, but guessing, reusing memory left some memory segments and it leads to a such memory leak even though it is intended. Unlike typical fasthttp services, the klaytn rpc request consumes different size of memory. For example, getBlockByNumber and getBlocknumber memory consumption is very different.
  • Anyway, the library provides an option to reduce memory consumption, and it works.

klay_getBlockByNumber(randomblocknumber) load test memory result

v1.9.1
soon, it leads to a out-of-memory
v1 9 1-getBlockByNumber(res)

v1.9.1 + PR
BTW, the continuous rising of memory is caused by accumulating trie cache
image

Types of changes

Please put an x in the boxes related to your change.

  • Bugfix
  • New feature or enhancement
  • Others

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • I have read the CONTRIBUTING GUIDELINES doc
  • I have signed the CLA
  • Lint and unit tests pass locally with my changes ($ make test)
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • Any dependent changes have been merged and published in downstream modules

Related issues

  • Please leave the issue numbers or links related to this PR here.

Further comments

If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0