etclabscore / core-geth

A highly configurable Go implementation of the Ethereum protocol.
https://etclabscore.github.io/core-geth
GNU Lesser General Public License v3.0
268 stars 147 forks source link

v1.12.9 high cpu usage #524

Closed Notation closed 1 year ago

Notation commented 1 year ago

Hello, after upgrading from v1.12.8 to v1.12.9, the cpu usage of core-geth continues to be high. How can I solve this problem? HDD io is OK

System information

Expected behaviour

less cpu usage

Actual behaviour

v1.12.8

image

v1.12.9

image

Steps to reproduce the behaviour

upgrade from v1.12.8 to v1.12.9

Backtrace

meowsbits commented 1 year ago

Thanks for the report. I'm just in the middle of looking at this now.

txSenderCacher seems suspect.

ia@ianuc:~/Downloads$ go tool pprof profile\(2\)                                                                                                                                                                
File: geth                                                                                                                                                                                                      Build ID: 2a4f22ee8855c29f44a2a89684537cf6e595fa37                                                                                                                                                              
Type: cpu                                                                                                                                                                                                       
Time: Feb 6, 2023 at 11:07am (PST)                                                                                                                                                                              
Duration: 5.18s, Total samples = 57.12s (1102.14%)                                                                                                                                                              Entering interactive mode (type "help" for commands, "o" for options)                                                                                                                                           
(pprof) top                                                                                                                                                                                                     
Showing nodes accounting for 57.04s, 99.86% of 57.12s total                                                                                                                                                     Dropped 34 nodes (cum <= 0.29s)                                                                         
      flat  flat%   sum%        cum   cum%                                                                                                                                                                      
    21.40s 37.46% 37.46%     57.05s 99.88%  github.com/ethereum/go-ethereum/core.(*txSenderCacher).cache                                                                                                        
    15.99s 27.99% 65.46%     21.36s 37.39%  runtime.chanrecv                                                                                                                                                    
    14.28s 25.00% 90.46%     35.64s 62.39%  runtime.selectnbrecv                                                                                                                                                
     5.37s  9.40% 99.86%      5.37s  9.40%  runtime.empty (inline)