]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commit
rgw/rbdmirror: use service dump instead of ceph -s
authorDimitri Savineau <dsavinea@redhat.com>
Mon, 26 Oct 2020 21:49:47 +0000 (17:49 -0400)
committerGuillaume Abrioux <gabrioux@redhat.com>
Tue, 3 Nov 2020 13:32:09 +0000 (14:32 +0100)
commit9c70add66174b06fca884b5d97349e9aa754d0b4
treeb1ee251f2d5a9f86503d229f787af094b817041e
parent3bba1fd203ccf10fc9726570f20d875846c827d9
rgw/rbdmirror: use service dump instead of ceph -s

The ceph status command returns a lot of information stored in variables
and/or facts which could consume resources for nothing.
When checking the rgw/rbdmirror services status, we're only using the
servicmap structure in the ceph status output.
To optimize this, we could use the ceph service dump command which contains
the same needed information.
This command returns less information and is slightly faster than the ceph
status command.

$ ceph status -f json | wc -c
2001
$ ceph service dump -f json | wc -c
1105
$ time ceph status -f json > /dev/null

real 0m0.557s
user 0m0.516s
sys 0m0.040s
$ time ceph service dump -f json > /dev/null

real 0m0.454s
user 0m0.434s
sys 0m0.020s

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
(cherry picked from commit 3f9081931f8a369b075060083cdb225e3477f99a)
infrastructure-playbooks/shrink-rbdmirror.yml
infrastructure-playbooks/shrink-rgw.yml
roles/ceph-facts/tasks/facts.yml