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

cmd/geth, ethdb/pebble: improve database statistic #29948

Merged
merged 4 commits into from
Jun 19, 2024

Conversation

hadv
Copy link
Contributor

@hadv hadv commented Jun 6, 2024

No description provided.

@hadv hadv requested a review from rjl493456442 June 7, 2024 06:09
@rjl493456442
Copy link
Member

I am considering whether we should return all database statistics instead of just one particular property. From a UX perspective, it is nearly impossible for users to know which database properties are available for dumping. Additionally, LevelDB and Pebble have different statistic definitions, which could add more complexity.

Will discuss with team and turn this pull request into a meaningful improvement.

@hadv hadv changed the title cmd/geth, ethdb/pebble: polish method naming and code comment cmd/geth, ethdb/pebble: implement more details stats for pebble db Jun 8, 2024
@hadv
Copy link
Contributor Author

hadv commented Jun 8, 2024

I am considering whether we should return all database statistics instead of just one particular property. From a UX perspective, it is nearly impossible for users to know which database properties are available for dumping. Additionally, LevelDB and Pebble have different statistic definitions, which could add more complexity.

Will discuss with team and turn this pull request into a meaningful improvement.

by the way, if geth still support leveldb then it's still valid to re-open this PR #25154 ?

@karalabe
Copy link
Member

We want to drop leveldb, but I'm guessing anyone who runs an arhcive node might have it in leveldb due to thesheer time it takes to resync. So will drop leveldb when we ship pathdb archive. But we don't want to expand on it.

@rjl493456442
Copy link
Member

Leveldb statistics

> debug.chaindbProperty()
 Level |   Tables   |    Size(MB)   |    Time(sec)  |    Read(MB)   |   Write(MB)
-------+------------+---------------+---------------+---------------+---------------
   0   |          2 |     521.87546 |       0.00000 |       0.00000 |       0.00000
   1   |         49 |      98.88743 |       0.00000 |       0.00000 |       0.00000
   2   |        495 |     999.71328 |       0.00000 |       0.00000 |       0.00000
   3   |         26 |      52.53258 |       0.00000 |       0.00000 |       0.00000
-------+------------+---------------+---------------+---------------+---------------
 Total |        572 |    1673.00874 |       0.00000 |       0.00000 |       0.00000
-------+------------+---------------+---------------+---------------+---------------

Read(MB):39.01844 Write(MB):37.55427
BlockCache(MB):6.82367 FileCache:4
MemoryCompaction:0 Level0Compaction:0 NonLevel0Compaction:0 SeekCompaction:0
WriteDelayCount:0 WriteDelayDuration:0s Paused:false
Snapshots:0 Iterators:0

Pebble statistics

> debug.chaindbProperty()
      |                             |       |       |   ingested   |     moved    |    written   |       |    amp   |     multilevel
level | tables  size val-bl vtables | score |   in  | tables  size | tables  size | tables  size |  read |   r   w  |    top   in  read
------+-----------------------------+-------+-------+--------------+--------------+--------------+-------+----------+------------------
    0 |     9  208MB     0B       0 |  0.50 |    0B |     0     0B |     0     0B |     0     0B |    0B |   1  0.0 |    0B    0B    0B
    1 |     0     0B     0B       0 |  0.00 |    0B |     0     0B |     0     0B |     0     0B |    0B |   0  0.0 |    0B    0B    0B
    2 |    34   51MB     0B       0 |  0.93 | 1.8KB |     0     0B |     1  191MB |     1  1.9MB | 1.9MB |   1 1052 |    0B    0B    0B
    3 |   271  327MB     0B       0 |  0.72 | 192MB |     0     0B |     0     0B |     3  194MB | 194MB |   1  1.0 |    0B    0B    0B
    4 |   737  1.5GB     0B       0 |  0.45 | 191MB |     0     0B |     0     0B |     1  192MB | 381MB |   1  1.0 |    0B    0B    0B
    5 |   697  102MB     0B       0 |  0.00 |  20MB |     0     0B |     0     0B |   196   21MB |  24MB |   1  1.0 | 8.8MB  20MB  24MB
    6 |  123K  232GB     0B       0 |     - |    0B |     0     0B |     0     0B |     0     0B |    0B |   1  0.0 |    0B    0B    0B
total |  125K  234GB     0B       0 |     - | 5.9KB |     0     0B |     1  191MB |   201  409MB | 601MB |   6 71606 | 8.8MB  20MB  24MB
---------------------------------------------------------------------------------------------------------------------------------------
WAL: 1 files (5.9KB)  in: 5.8KB  written: 5.9KB (0% overhead)
Flushes: 0
Compactions: 11  estimated debt: 839MB  in progress: 0 (0B)
             default: 10  delete: 0  elision: 0  move: 1  read: 0  rewrite: 0  multi-level: 6
MemTables: 1 (256KB)  zombie: 1 (256MB)
Zombie tables: 0 (0B)
Backing tables: 0 (0B)
Virtual tables: 0 (0B)
Block cache: 125K entries (90MB)  hit rate: 0.8%
Table cache: 125K entries (95MB)  hit rate: 70.6%
Secondary cache: 0 entries (0B)  hit rate: 0.0%
Snapshots: 0  earliest seq num: 0
Table iters: 0
Filter utility: 72.3%
Ingestions: 0  as flushable: 0 (0B in 0 tables)

null

@rjl493456442 rjl493456442 changed the title cmd/geth, ethdb/pebble: implement more details stats for pebble db cmd/geth, ethdb/pebble: improve database statistic Jun 19, 2024
@rjl493456442 rjl493456442 added this to the 1.14.6 milestone Jun 19, 2024
@rjl493456442 rjl493456442 merged commit 67a862d into ethereum:master Jun 19, 2024
3 checks passed
@hadv hadv deleted the polish-naming-and-comment branch June 19, 2024 07:06
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.

4 participants