]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commit
osds: use pg stat command instead of ceph status
authorDimitri Savineau <dsavinea@redhat.com>
Mon, 26 Oct 2020 15:23:01 +0000 (11:23 -0400)
committerGuillaume Abrioux <gabrioux@redhat.com>
Tue, 3 Nov 2020 13:32:09 +0000 (14:32 +0100)
commita8e2bc087f69a4098cb75086c0a8d5b504e3426a
tree00628620caa98c2a08fdcf89bbc4c81b930ff649
parentb4c1f325a891c73fa2a3adc67e527b49f44e06cd
osds: use pg stat command instead of ceph status

The ceph status command returns a lot of information stored in variables
and/or facts which could consume resources for nothing.
When checking the pgs state, we're using the pgmap structure in the ceph
status output.
To optimize this, we could use the ceph pg stat command which contains
the same needed information.
This command returns less information (only about pgs) and is slightly
faster than the ceph status command.

$ ceph status -f json | wc -c
2000
$ ceph pg stat -f json | wc -c
240
$ time ceph status -f json > /dev/null

real 0m0.529s
user 0m0.503s
sys 0m0.024s
$ time ceph pg stat -f json > /dev/null

real 0m0.426s
user 0m0.409s
sys 0m0.016s

The data returned by the ceph status is even bigger when using the
nautilus release.

$ ceph status -f json | wc -c
35005
$ ceph pg stat -f json | wc -c
240

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
(cherry picked from commit ee505885908ac2ae15bf201a638359faaf78d251)
infrastructure-playbooks/cephadm-adopt.yml
infrastructure-playbooks/rolling_update.yml
infrastructure-playbooks/switch-from-non-containerized-to-containerized-ceph-daemons.yml