Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

E3: Pruning takes way too much time on a weak machine #12502

Open
Giulio2002 opened this issue Oct 25, 2024 · 1 comment
Open

E3: Pruning takes way too much time on a weak machine #12502

Giulio2002 opened this issue Oct 25, 2024 · 1 comment
Assignees
Milestone

Comments

@Giulio2002
Copy link
Contributor

So

if err := e.executionPipeline.RunPrune(e.db, tx, initialCycle); err != nil {
				return err
			}

takes 24 seconds to execute - this causes us to be always 3 blocks behind. it could be due to state pruning, in which case:

pruneTimeout := 250 * time.Millisecond
	if s.CurrentSyncCycle.IsInitialCycle {
		pruneTimeout = 12 * time.Hour
	}
	if _, err = tx.(*temporal.Tx).AggTx().(*libstate.AggregatorRoTx).PruneSmallBatches(ctx, pruneTimeout, tx); err != nil { // prune part of retired data, before commit
		return err
	}

there is some unexpected behaviour here.

@Giulio2002 Giulio2002 added this to the 3.0.0-alpha6 milestone Oct 25, 2024
@AskAlexSharov AskAlexSharov self-assigned this Oct 26, 2024
@AskAlexSharov
Copy link
Collaborator

There are many things we can do:

  • can replace 250ms by heuristic like: 4sec and tx.DirtySpace() < 64mb
  • to not fsync prune, fsync only exec. E2 did it. (it's ok to fsync every 2nd rwtx in mdbx)
  • E3 has +1 fsync compare to E2: rawdb.WriteLastNewBlockSeen (maybe it impacting chain-tip also)
  • re-visit prune: make it do less random-deletes on chain-tip
  • delete prefixes instead of individual keys
  • reduce chaindata size (InvertedIndexes schema)
  • non-nvme drive may benefit from bigger pageSize (fsync will be faster because
  • etc...

I will take a look

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@Giulio2002 @AskAlexSharov and others