Open UMU618 opened 4 years ago
Can you point to any reference information on this?
Post always queues, maximizing the possibility for thread utilization. The load imbalance among threads in nodeos is not related to the use of post()
.
@jgiszczak I think the problem is in net_plugin:
strand + post make tasks executed in main thread.
These functions are in deep call stack:
fc::sha256::encoder::write(char const*, unsigned int)
eosio::connection::queue_write(std::__1::shared_ptr<std::__1::vector<char, std::__1::allocator<char> > > const&, bool, int, std::__1::function<void (boost::system::error_code, unsigned long)>, bool)
eosio::dispatch_manager::bcast_transaction(std::__1::shared_ptr<eosio::chain::transaction_metadata> const&)
eosio::chain::signed_block::~signed_block()
boost::signals2::detail::slot_call_iterator_t<boost::signals2::detail::variadic_slot_invoker<boost::signals2::detail::void_type, std::__1::tuple<std::__1::shared_ptr<eosio::chain::transaction_trace> const&, eosio::chain::signed_transaction const&> >, std::__1::__list_iterator<boost::shared_ptr<boost::signals2::detail::connection_body<std::__1::pair<boost::signals2::detail::slot_meta_group, boost::optional<int> >, boost::signals2::slot<void (std::__1::tuple<std::__1::shared_ptr<eosio::chain::transaction_trace> const&, eosio::chain::signed_transaction const&>), boost::function<void (std::__1::tuple<std::__1::shared_ptr<eosio::chain::transaction_trace> const&, eosio::chain::signed_transaction const&>)> >, boost::signals2::mutex> >, void*>, boost::signals2::detail::connection_body<std::__1::pair<boost::signals2::detail::slot_meta_group, boost::optional<int> >, boost::signals2::slot<void (std::__1::tuple<std::__1::shared_ptr<eosio::chain::transaction_trace> const&, eosio::chain::signed_transaction const&>), boost::function<void (std::__1::tuple<std::__1::shared_ptr<eosio::chain::transaction_trace> const&, eosio::chain::signed_transaction const&>)> >, boost::signals2::mutex> >::dereference() const
Run
top -H -p <PID of nodeos>
, we see the main thread is too busy, while the others are low cost.EOS CPU Usage is always 100% which only use one cpu core. #8476