-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Geth memory leak on json-rpc response gzip compression #1801
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
Comments
Hi there, thanks for the details shared. We will look into this and advise when we have more details on this. |
Hi @VladStarr , I am reproducing this problem, which may take some time. If convenient, could you please provide the goroutinue result of pprof? You can obtain it with the following command:
|
Hi @VladStarr , when using a simple rpc request, such as
|
same... |
@du5 Could you provide some details about the problem? like goroutine profile, heap profile, RPC msg scenarios? |
Hi @galaio, the top 3 methods which node is serving are:
Goroutine profile attached. Also attached fresh heap dump. I can't tell that there are any long-running requests, the most time-consuming request is Other types of nodes (Geth/Polygon/etc) do not have this problem. 20230821_1017_pprof_goroutine.gz |
lol... I don't think this problem comes from bsc and there is no way to fix it in the short term, I reduced the memory usage by turning off gzip, https://github.com/du5/bsc-geth-disable-gzip |
System information
Geth version:
Geth Version: 1.2.9 Architecture: amd64 Go Version: go1.19.11 Operating System: linux
OS & Version:
Linux public-bsc-0 5.15.0-70-generic #77-Ubuntu SMP Tue Mar 21 14:02:37 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Commit hash : (if
develop
)CLI args:
geth --config=/config/config.toml --datadir=/data --syncmode=full --gcmode=full --maxpeers=50 --cache=8192 --snapshot=true --pipecommit=false --persistdiff=false --diffblock=86400 --port=30311 --rpc.allow-unprotected-txs --txlookuplimit=0 --cache.preimages --ws --tries-verify-mode=none --metrics --pprof --pprof.addr=0.0.0.0 --pprof.port=6060 --pruneancient=true
Expected behaviour
Geth should not have memory leak when responding with Gzip-compressed data.
In our case every JSON-RPC request to node has
Accept-Encoding: gzip, deflate
.Actual behaviour
Memory is leaking when all requests to Geth are sent with
Accept-Encoding: gzip, deflate
header and Geth is killed because of OOM.Steps to reproduce the behaviour
Accept-Encoding: gzip, deflate
will be added to each JSON-RPC request.eth_call
oreth_getLogs
. Our node serves at least 50 RPS.Backtrace
Accept-Encoding: gzip, deflate
is present in each request from reverse proxyAccept-Encoding
header is not present at allpprof heap SVG:
leak
without_gzip
pprof heap dump:
leak.heap.gz
without_gzip.heap.gz
memory usage graph
red separator - after disabling compression

config.toml
config.toml.gz
The text was updated successfully, but these errors were encountered: