polygon-edge icon indicating copy to clipboard operation
polygon-edge copied to clipboard

cpu load very high

Open tiankonglan opened this issue 1 year ago • 6 comments

[Subject of the issue]

Description

after uprade code , I run 4 node in pos consensus, one by one cpu load up to 100%

Your environment

  • arm Mac 12.5 and aws ec2 server
  • v0.5.0 and the newest code commit id : fb219ba224300db08253e67d9cd62d32093cc0da
  • develop

Steps to reproduce

I run 4 node in pos consensus

Expected behaviour

cpu load normal

Actual behaviour

one by one cpu load up to 100%

Logs

ec2 server cpu profile top image

mac cpu profile top image

mac cpu profile pprof pdf profile001.pdf

Proposed solution

consensus_backend.go

func (i *backendIBFT) writeTransactions(
	gasLimit,
	blockNumber uint64,
	transition transitionInterface,
) (executed []*types.Transaction) {
...
	for {
		select {
		case <-blockTimer.C:
			return
		default:
			if stopExecution {
				//	wait for the timer to expire
				continue
			}
...

maybe the code cause the problem , both my envirenment have no transcation

tiankonglan avatar Aug 13 '22 13:08 tiankonglan

Hey @tiankonglan , thank for raising the issue.

It was discovered by the dev team last week and a fix is under way.

dbrajovic avatar Aug 15 '22 08:08 dbrajovic

Hey @tiankonglan,

We have a PR out to resolve this issue, thank you for the patience 🙏

https://github.com/0xPolygon/polygon-edge/pull/691

zivkovicmilos avatar Aug 18 '22 14:08 zivkovicmilos

great, I will pull it and verify . @zivkovicmilos

tiankonglan avatar Aug 19 '22 13:08 tiankonglan

I pull the #691 code and run my scence, the cpu is also hight . profile001.pdf @zivkovicmilos @dbrajovic

tiankonglan avatar Aug 19 '22 14:08 tiankonglan

Thanks for the update, @tiankonglan

We updated the PR with a second fix. Have another go and tell us if the problem persists 👍

dbrajovic avatar Aug 22 '22 10:08 dbrajovic

@dbrajovic great, I use the PR in my scene, all nodes cpu are normal.

tiankonglan avatar Aug 25 '22 01:08 tiankonglan