Skip to content

txIndexer.report() method uses too much cpu on sepolia network #28907

Closed
@cifer76

Description

@cifer76

System information

Geth version: v1.13.11
CL client & version: [email protected]
OS & Version: Linux

Steps to reproduce the behaviour

We have been running an archive node for sepolia network, the node also serves the eth_getTransactionReceipt calls at a rate of 150 QPS, this call serves very well until we upgrading to v1.13.11, which causes eth_getTransactionReceipt at a very high latency (p95 >5 seconds).

I dug a bit on the eth_getTransactionReceipt method and found that in v1.13.11 if the transaction is not found atm it will trigger a progress query on the txIndexer.txIndexProgress(), the txIndexProgress() method then trigger the txIndexer.report() method and get the progress from the txIndexer mainloop through a channel. (Well I don't think it's suitable to have a channel on the path of serving a RPC call, but let's hold on that for now.)

The real cause of the high latency is inside the txIndexer.report(), it can trace to the deep internals of pebble and finally stop at the crc32.Update() method and Syscall6().

image

as you can see txIndexer.report() takes 81% of the sampled CPU time.

node startup options

geth
 --sepolia \
                  --datadir=/var/data/geth \
                  --syncmode=full \
                  --snapshot=false \
                  --cache=1024 \
                  --txlookuplimit=0 \
                  --http \
                  --http.addr=0.0.0.0 \
                  --http.port=8545 \
                  --http.vhosts=* \
                  --http.api=net,web3,eth,txpool,pre,engine,trace \
                  --ws \
                  --ws.addr=0.0.0.0 \
                  --ws.port=8546 \
                  --ws.origins=* \
                  --ws.api=net,web3,eth,txpool,engine \
                  --rpc.allow-unprotected-txs \
                  --metrics \
                  --pprof \
                  --pprof.addr=0.0.0.0 \
                  --pprof.port=9260 \
                  --allow-insecure-unlock \
                  --rpc.gascap=250000000 \
                  --authrpc.addr=0.0.0.0 \
                  --authrpc.port=8551 \
                  --authrpc.jwtsecret=/var/data/geth/jwt.hex \
                  --authrpc.vhosts=* \
                  --state.scheme=path \
                  --db.engine=pebble \
                  --history.transactions=0

Update

While things has not ended. We also run a mainnet ethereum node and also upgraded to v1.13.11, but the latency of the eth_getTransactionReceipt is just as low as before(p95 ~1ms). So I also capture a cpu profile for the mainnet node, btw the mainnet node and the sepolia roughly serve the same kinds and the same amount of RPC calls, but as we can see in mainnet cpu profile the txIndexer.report() only takes 0.4% of the sampled CPU time.

image

we can see in mainnet node's pprof it doesn't run into the crc32.Update and the Syscall6 method, maybe it's quite related to pebbledb or the db hierarchy between sepolia and mainnet...

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions