Created
January 30, 2018 09:12
-
-
Save wido/875d531692a922d608b9392e1766405d to your computer and use it in GitHub Desktop.
Ceph OSD BlueStore database size
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# For each running OSD query the BlueStore DB size and entries and calculate avg size per entry | |
# | |
# Author: Wido den Hollander <[email protected]> | |
# | |
for OSD_ID in $(find /var/run/ceph -name 'ceph-osd.*.asok' -type s -printf "%f\n"|cut -d '.' -f 2); do | |
DB_USED_BYTES=$(ceph daemon osd.$OSD_ID perf dump|jq '.bluefs.db_used_bytes') | |
BLUESTORE_ONODES=$(ceph daemon osd.$OSD_ID perf dump|jq '.bluestore.bluestore_onodes') | |
echo "osd.$OSD_ID: db_used_bytes=$DB_USED_BYTES bluestore_onodes=$BLUESTORE_ONODES db_entry_size=$(($DB_USED_BYTES / BLUESTORE_ONODES))" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment