Slow Performance in setup of SLES 11 SP3 Remote Virtual Machines (100sec)

33 views
Skip to first unread message

Anas Theo

unread,
Oct 10, 2016, 11:23:41 AM10/10/16
to Ansible Project
Hello everyone,

I have installed  Ansible in Centos 7 minimal environment , using the latest version in EPEL (ansible-2.1.1.0-1.el7.noarch). I have to deal with a very strange phenomenon where the execution of a .yml configuration goes very slow, when I have to execute it for some remote SLES 11 SP3 virtual machines. It seems that for these remote virtual machines, 100sec have to be completed before the setup goes forward. I have tested the same .yml for Centos 7 remote machines, and works fine, and I have also tested in another environenment with Centos6 and SLES11 SP2 virtual machines, and they work just fine. I have tested the execution as root or non-privileged user without differences. In cases that I'm going to stop the execution in the middle, an indication like this may be written. 

  File "/usr/lib64/python2.7/multiprocessing/process.py", line 258, in _bootstrap
  File "/usr/lib64/python2.7/multiprocessing/process.py", line 258, in _bootstrap
    self.run()
  File "/usr/lib/python2.7/site-packages/ansible/executor/process/worker.py", line 117, in run
    self.run()
  File "/usr/lib/python2.7/site-packages/ansible/executor/process/worker.py", line 117, in run
    self._rslt_q
    self._rslt_q
  File "/usr/lib/python2.7/site-packages/ansible/executor/task_executor.py", line 124, in run
  File "/usr/lib/python2.7/site-packages/ansible/executor/task_executor.py", line 124, in run

I have captured also some traces through tcpdump where the connection between two nodes is being seen and 100seconds where the remote nodes, are waiting to respond are evident. Is there any idea ?!!! 

Anas Theo

unread,
Oct 11, 2016, 8:47:49 AM10/11/16
to Ansible Project
I managed to investigate the issue. The problem was that all servers with slow performance have DNS server configured in /etc/resolv.conf. When DNS server search is disabled then node setup is ok. Now, I have to find a solution about how we can overcome this problem with DNS search. 

Anas Theo

unread,
Oct 13, 2016, 9:47:06 AM10/13/16
to Ansible Project
As I have described in the previous comment, the problem was due to DNS searching for a DNS server that has not been accessible from the hosts. For that reason, I have tried to setup for these hosts, only the variable that I was going to use, using filter options like "filter=ansible_hostname" . However, it seems that the search time is the same. Is there any option to get the facts I want independently from the rest of them, in order to boost the performance of setup. Thanks for your help.


Τη Δευτέρα, 10 Οκτωβρίου 2016 - 6:23:41 μ.μ. UTC+3, ο χρήστης Anas Theo έγραψε:

Kai Stian Olstad

unread,
Oct 13, 2016, 11:35:51 AM10/13/16
to ansible...@googlegroups.com
On 13. okt. 2016 15:47, 'Anas Theo' via Ansible Project wrote:
> As I have described in the previous comment, the problem was due to DNS
> searching for a DNS server that has not been accessible from the hosts. For
> that reason, I have tried to setup for these hosts, only the variable that
> I was going to use, using filter options like "filter=ansible_hostname" .
> However, it seems that the search time is the same. Is there any option to
> get the facts I want independently from the rest of them, in order to boost
> the performance of setup. Thanks for your help.

The setup module have gather_subset.
Set gather_facts to false and run the setup module with a subset in the
playbook.

- setup: gather_subset=!all

This will give very few facts, maybe this one is faster?

Or you could disable gather_facts and just run the same command as
ansible do the find hostname.

- command: python -c "import platform; print platform.node().split('.')[0]"
register: hostname

If you have the same name in ansible inventory file you could just use
inventory_hostname, then you would not need to gather facts at all.

--
Kai Stian Olstad
Reply all
Reply to author
Forward
0 new messages