Skip to content

feat(bin): db freelist metric#4346

Merged
shekhirin merged 2 commits intomainfrom
alexey/db-freelist-metric
Aug 24, 2023
Merged

feat(bin): db freelist metric#4346
shekhirin merged 2 commits intomainfrom
alexey/db-freelist-metric

Conversation

@shekhirin
Copy link
Member

@shekhirin shekhirin commented Aug 24, 2023

Resolves #4287

reth (alexey/db-freelist-metric) ./db-tools/mdbx_stat -qff ~/Library/Application\ Support/reth/sepolia/db/mdbx.dat | grep GC
  GC: 62 pagesreth (alexey/db-freelist-metric) curl -s localhost:9001 | grep '^reth_db_freelist'
reth_db_freelist 62

Implementation changes in freelist are due to MDBX always using 32 bits for page numbers.

LMDB page numbers: https://github.com/LMDB/lmdb/blob/c7b3cc4df6dfe8f0772fb509bdc74777667caa43/libraries/liblmdb/lmdb.h#L190-L208
MDBX page numbers:

/* A page number in the database.
*
* MDBX uses 32 bit for page numbers. This limits database
* size up to 2^44 bytes, in case of 4K pages. */
typedef uint32_t pgno_t;

@shekhirin shekhirin added C-enhancement New feature or request A-db Related to the database A-observability Related to tracing, metrics, logs and other observability tools labels Aug 24, 2023
@codecov
Copy link

codecov bot commented Aug 24, 2023

Codecov Report

Merging #4346 (daa8002) into main (b473f20) will decrease coverage by 0.16%.
Report is 1 commits behind head on main.
The diff coverage is 25.00%.

Impacted file tree graph

Files Changed Coverage Δ
bin/reth/src/prometheus_exporter.rs 0.00% <0.00%> (ø)
crates/storage/libmdbx-rs/src/environment.rs 80.80% <100.00%> (+0.37%) ⬆️

... and 11 files with indirect coverage changes

Flag Coverage Δ
integration-tests 16.72% <25.00%> (-0.04%) ⬇️
unit-tests 63.73% <0.00%> (-0.14%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
reth binary 26.01% <0.00%> (-0.02%) ⬇️
blockchain tree 82.56% <ø> (ø)
pipeline 90.07% <ø> (ø)
storage (db) 74.72% <100.00%> (+<0.01%) ⬆️
trie 94.88% <ø> (+0.03%) ⬆️
txpool 47.94% <ø> (-0.51%) ⬇️
networking 77.54% <ø> (+0.06%) ⬆️
rpc 57.99% <ø> (-0.82%) ⬇️
consensus 63.53% <ø> (ø)
revm 31.97% <ø> (ø)
payload builder 6.78% <ø> (ø)
primitives 86.36% <ø> (ø)

@shekhirin shekhirin marked this pull request as ready for review August 24, 2023 13:53
@shekhirin shekhirin force-pushed the alexey/db-freelist-metric branch from 7f455a3 to daa8002 Compare August 24, 2023 13:55
@shekhirin shekhirin requested review from mattsse and rkrasiuk and removed request for rakita August 24, 2023 14:06
@shekhirin shekhirin added this pull request to the merge queue Aug 24, 2023
Merged via the queue into main with commit 9791304 Aug 24, 2023
@shekhirin shekhirin deleted the alexey/db-freelist-metric branch August 24, 2023 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-db Related to the database A-observability Related to tracing, metrics, logs and other observability tools C-enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expose MDBX garbage collection metric

2 participants