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

fs: add statistics #6

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open

fs: add statistics #6

wants to merge 2 commits into from

Conversation

skyzh
Copy link
Collaborator

@skyzh skyzh commented Jul 16, 2021

This PR adds statistics API for ZenFS. Users can get statistics information from zenFS->GetStat(). It is also possible to print statistics in human-readable format with ZenFS cli tool ./zenfs stat --zbd=nvme3n2.

Example output from the cli tool:

Zone total=1129316352 write_position=67701309440 start_position=66571993088
  [297] test_db/000296.sst 135135823
  [314] test_db/000313.sst 135136461
Zone total=1129316352 write_position=69848793088 start_position=68719476736
  [166] test_db/000165.sst 135140690
Zone total=1129316352 write_position=71996276736 start_position=70866960384
  [319] test_db/000318.sst 135136421
Zone total=1129316352 write_position=74143760384 start_position=73014444032
  [167] test_db/000166.sst 135140661
Zone total=1129316352 write_position=76291244032 start_position=75161927680
  [309] test_db/000308.sst 135140458
Zone total=1129316352 write_position=78438727680 start_position=77309411328
  [1066] test_db/001065.sst 135131464

Signed-off-by: Alex Chi [email protected]

@skyzh skyzh mentioned this pull request Jul 16, 2021
skyzh added a commit to skyzh/terarkdb that referenced this pull request Jul 19, 2021
This PR adds GC for ZNS. Here's how it works:

* We use the statistics interface added in
  bzbd/zenfs#6, where we can get what size
  each file occupies in each zone.
* We spawn a ZNSGC task in the background, which works like TTLGC.
  It polls statistics from ZenFS every 10s.
* The task will find all full zones with 50% garbage (by default)
  and mark files in that zone for GC.

Along with ZNS GC, other features are added.

* We added `zenfs_gc_ratio` option in db_bench command.
* We fixed a bug where files may be deleted before closed.

Signed-off-by: Alex Chi <[email protected]>
Signed-off-by: Alex Chi <[email protected]>
Signed-off-by: Alex Chi <[email protected]>
levichen94 added a commit to bytedance/terarkdb that referenced this pull request Sep 14, 2021
Original commit message:

This PR adds GC for ZNS. Here's how it works:

  We use the statistics interface added in fs: add statistics bzbd/zenfs#6, where we can get what size each file occupies in each zone.
  We spawn a ZNSGC task in the background, which works like TTLGC. It polls statistics from ZenFS every 10s.
  The task will find all full zones with 50% garbage (by default) and mark files in that zone for GC.
  Along with ZNS GC, other features are added.

  We added zenfs_gc_ratio option in db_bench command.
  We fixed a bug where files may be deleted before closed.
----------------------------------------------------------------------
Author: Alex Chi [email protected]

Signed-off-by: Changlong Chen [email protected]
levichen94 pushed a commit to bytedance/terarkdb that referenced this pull request Sep 14, 2021
This PR adds GC for ZNS. Here's how it works:

* We use the statistics interface added in
  bzbd/zenfs#6, where we can get what size
  each file occupies in each zone.
* We spawn a ZNSGC task in the background, which works like TTLGC.
  It polls statistics from ZenFS every 10s.
* The task will find all full zones with 50% garbage (by default)
  and mark files in that zone for GC.

Along with ZNS GC, other features are added.

* We added `zenfs_gc_ratio` option in db_bench command.
* We fixed a bug where files may be deleted before closed.

Signed-off-by: Alex Chi <[email protected]>
@royguo royguo changed the base branch from master to dev September 15, 2021 12: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.

1 participant