EOSIO / eos

An open source smart contract platform
https://developers.eos.io/manuals/eos
MIT License
11.28k stars 3.6k forks source link

Need to improve multi-core processing #8551

Open UMU618 opened 4 years ago

UMU618 commented 4 years ago

Run top -H -p <PID of nodeos>, we see the main thread is too busy, while the others are low cost.

image

image

image

image

EOS CPU Usage is always 100% which only use one cpu core. #8476

heifner commented 4 years ago

Can you point to any reference information on this?

jgiszczak commented 4 years ago

Post always queues, maximizing the possibility for thread utilization. The load imbalance among threads in nodeos is not related to the use of post().

UMU618 commented 4 years ago

@jgiszczak I think the problem is in net_plugin:

https://github.com/EOSIO/eos/blob/880c9c4186911d0faa3dcf64cdaab8042a7a0188/plugins/net_plugin/net_plugin.cpp#L176-L179

strand + post make tasks executed in main thread.

UMU618 commented 4 years ago

These functions are in deep call stack:

https://github.com/EOSIO/eos/blob/880c9c4186911d0faa3dcf64cdaab8042a7a0188/plugins/net_plugin/net_plugin.cpp#L1099-L1101