Skip to content

Conversation

@bkchr
Copy link
Member

@bkchr bkchr commented Nov 27, 2025

We have realized that force compacting an archive node with more than 600GB of disk is not such a great idea :) It takes up to 1h and 30min for the node to finish this task. Subsequent starts are also not faster..

We have realized that force compacting an archive node with more than 600GB of disk is not such a great idea :)
It takes up to 1h and 30min for the node to finish this task. Subsequent starts are also not faster..
// After opening the DB, we want to compact it.
//
// This just in case the node crashed before to ensure the db stays fast.
db.force_compaction()?;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dq: This is not limited to archive nodes, but we have observed this while running archives?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had tested this before mainly with warp synced nodes. Aka not a node that has a 600GB disk 🙈

That it takes ages was detected while trying to switch to the stable25rc1 release on our westend nodes.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, this must be the fix for the westend nodes that were killed by the keep-alive/health-check services 🙏

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes this is the fix for them.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested it locally with the archive db. Before my PC was also not able to compact it in any reasonable amount of time.

@skunert
Copy link
Contributor

skunert commented Nov 27, 2025

Hmm but we will have to remove the compaction on large write too right? Because if a large write happens we also don't want to wait for hours.

@bkchr
Copy link
Member Author

bkchr commented Nov 27, 2025

Hmm but we will have to remove the compaction on large write too right? Because if a large write happens we also don't want to wait for hours.

We would need to write more than 64MiB, which should only happen at warp sync. I can increase this to 128MiB if you like. We don't warp sync archive nodes.

@skunert
Copy link
Contributor

skunert commented Nov 27, 2025

Hmm but we will have to remove the compaction on large write too right? Because if a large write happens we also don't want to wait for hours.

We would need to write more than 64MiB, which should only happen at warp sync. I can increase this to 128MiB if you like. We don't warp sync archive nodes.

Hmm okay, I was not sure that we can make this general assumption.

@bkchr
Copy link
Member Author

bkchr commented Nov 27, 2025

Hmm okay, I was not sure that we can make this general assumption.

Blocks have a max size of ~10MiB. So, writing that 128MiB sounds hard. Let me set it to 256MiB to be more safe.

Copy link

@lrubasze lrubasze left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

I presume DB compaction is performed automatically anyway in the background?

@michalkucharczyk
Copy link
Contributor

michalkucharczyk commented Nov 28, 2025

Hmm okay, I was not sure that we can make this general assumption.

Blocks have a max size of ~10MiB. So, writing that 128MiB sounds hard. Let me set it to 256MiB to be more safe.

DQ: What would be "expected" write size if archive node goes offline for some time? Can it happen that we somehow exceed this anyway?

@bkchr bkchr changed the title Do not force compact rocksdb on startup Rocksdb: Force compact only on request Dec 1, 2025
@bkchr bkchr merged commit f503b4c into master Dec 1, 2025
6 checks passed
@bkchr bkchr deleted the bkchr-rocksdb-no-compaction-on-start branch December 1, 2025 14:59
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

Successfully merging this pull request may close these issues.

6 participants