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
fact gathering optimization for scalability #2553
Comments
The above patch should not work in general, as @guits explained to me, because ansible modules are interpreting vars about host B on the remote system A, so facts have to be gathered about B on the remote system A to allow these variables to be used (his example below). However, it may be possible to cut down on the possible (A, B) combinations that have to be fact-gathered to lower the work done in this task from O(N^2) to O(N), where N is the number of hosts in the ansible inventory file.
This might not be that hard to verify -- i.e. search for references to ansible "groups" var. A preliminary search seemed to confirm this. So the resulting patch might look something like this - only limited testing so far:
I am testing this on a 3-node cluster with a single monitor and all other roles defined on the other 2 nodes, using site.yml, and I verified that no fact gathering was done between pairs of non-monitor hosts, therefore it is now O(N) computational complexity. background: Guillaume Abrioux provided this example illustrating why ceph-ansible requires remote hosts to have facts about other hosts on hand:
results in output like this:
|
there is no need to gather facts with O(N^2) way. Only one node should gather facts from other node. Fixes: #2553 Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
there is no need to gather facts with O(N^2) way. Only one node should gather facts from other node. Fixes: #2553 Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
there is no need to gather facts with O(N^2) way. Only one node should gather facts from other node. Fixes: #2553 Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
there is no need to gather facts with O(N^2) way. Only one node should gather facts from other node. Fixes: #2553 Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
there is no need to gather facts with O(N^2) way. Only one node should gather facts from other node. Fixes: #2553 Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
there is no need to gather facts with O(N^2) way. Only one node should gather facts from other node. Fixes: #2553 Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
there is no need to gather facts with O(N^2) way. Only one node should gather facts from other node. Fixes: #2553 Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
The method in the 2nd comment seems to work. I do not totally understand why it works yet, particularly with respect to ceph.conf.j2, which has all sorts of references to vars in other groups besides 'mons'. Guillaume has proposed a much smaller patch that may accomplish the same thing - what does "run_once" addition actually do? |
there is no need to gather facts with O(N^2) way. Only one node should gather facts from other node. Fixes: #2553 Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
@bengland2 I think I was a bit confused with facts gathering topic but after some tests, it appears as soon as you've gathered fact 1 time for one node, it's available from any other node.
|
@guits @jtaleric @fultonj I tried it with 80 computes, 4 OSDs and 3 mons using ceph-ansible-3.1.0-0.1.rc3.el7cp.noarch and ansible 2.4.3. Memory consumption for this task dropped to near zero, very cool. But it still takes 10 minutes to get through this one fact gathering task, not as cool. I think it's doing 1 host at a time. I'm leaving the issue closed because the memory problem and O(N^2) behavior is fixed, maybe in a future release I'll take another look at the speed aspect. At least we now have a test methodology. |
Since we fixed the `gather and delegate facts` task, this exception is not needed anymore. It's a leftover that should be removed to save some time when deploying a cluster with a large client number. Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
Since we fixed the `gather and delegate facts` task, this exception is not needed anymore. It's a leftover that should be removed to save some time when deploying a cluster with a large client number. Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
Since we fixed the `gather and delegate facts` task, this exception is not needed anymore. It's a leftover that should be removed to save some time when deploying a cluster with a large client number. Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com> (cherry picked from commit 8288480) Signed-off-by: Sébastien Han <seb@redhat.com>
Since we fixed the `gather and delegate facts` task, this exception is not needed anymore. It's a leftover that should be removed to save some time when deploying a cluster with a large client number. Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com> (cherry picked from commit 8288480) Signed-off-by: Sébastien Han <seb@redhat.com>
Since we fixed the `gather and delegate facts` task, this exception is not needed anymore. It's a leftover that should be removed to save some time when deploying a cluster with a large client number. Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com> (cherry picked from commit 8288480)
Since we fixed the `gather and delegate facts` task, this exception is not needed anymore. It's a leftover that should be removed to save some time when deploying a cluster with a large client number. Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com> (cherry picked from commit 8288480)
The gather and delegate facts task is not scalable, and requires in general O(N^2) fact-gathering operations per host, but it is not clear to me why that should be. I have run tests with this patch that just gathers facts on a host ONCE, instead of N times, and ceph-ansible succeeds just the same. The effect on memory consumption and time to execute this task is dramatic. Particularly for HCI configurations, this could make a big difference in scalability of ceph-ansible.
Here's a graph of ansible RSS and virtual memory consumption before the patch, with --forks 25, 3 [osds] hosts, 3 [mons] hosts, and 80 [clients] hosts, running ansible 2.4.3 and ceph-ansible-3.1.0-0.1.beta8 starting at 18:35:
And here's the same exact run with the patch, starting at 19:56:
elapsed time for this one fact gathering task drops from 5 minutes to about 1 minute, and RSS drops from 8 GB to about 2 GB.
The text was updated successfully, but these errors were encountered: