Skip to content
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

modules: zypper: Optimize the 'search' subcommand #37191

Merged
merged 1 commit into from Mar 9, 2018

Conversation

hwoarang
Copy link
Contributor

@hwoarang hwoarang commented Mar 8, 2018

When looking for installed packages we do not need to query
repositories since we only care about the rpmdb. As such, we can
disable all the repositories operations in order to improve the
performance of that step

Before this patch, when using 'state: present' in the zypper module,
the operation was taking about 12 seconds to complete:

time ansible-playbook foo.yml 1>/dev/null

real 0m12.614s
user 0m10.880s
sys 0m0.683s

After this patch:

time ansible-playbook foo.yml 1>/dev/null

real 0m4.193s
user 0m2.560s
sys 0m0.575s

see:
https://bugzilla.opensuse.org/show_bug.cgi?id=1084525

SUMMARY
ISSUE TYPE
  • Feature Pull Request
  • New Module Pull Request
  • Bugfix Pull Request
  • Docs Pull Request
COMPONENT NAME
ANSIBLE VERSION

ADDITIONAL INFORMATION

When looking for installed packages we do not need to query
repositories since we only care about the rpmdb. As such, we can
disable all the repositories operations in order to improve the
performance of that step

Before this patch, when using 'state: present' in the zypper module,
the operation was taking about 12 seconds to complete:

time ansible-playbook foo.yml 1>/dev/null

real	0m12.614s
user	0m10.880s
sys	0m0.683s

After this patch:

time ansible-playbook foo.yml 1>/dev/null

real	0m4.193s
user	0m2.560s
sys	0m0.575s

see:
https://bugzilla.opensuse.org/show_bug.cgi?id=1084525
@ansibot
Copy link
Contributor

ansibot commented Mar 8, 2018

@ansibot ansibot added community_review In order to be merged, this PR must follow the community review workflow. feature This issue/PR relates to a feature request. module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. new_contributor This PR is the first contribution by a new community member. performance support:community This issue/PR relates to code supported by the Ansible community. labels Mar 8, 2018
Copy link
Contributor

@andytom andytom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.
shipit

@ansibot ansibot removed the needs_triage Needs a first human triage before being processed. label Mar 8, 2018
openstack-gerrit pushed a commit to openstack/openstack-ansible-tests that referenced this pull request Mar 8, 2018
Similar to the CentOS case, we should use 'present' instead of 'latest'
for the package state so we don't spend time resolving dependencies,
querying repos etc. The 'present' state can be further improved either
in the zypper itself or in the Ansible module.

Change-Id: I44fae44030af1c9ee88dcc26c6b55c91a2531926
Link: ansible/ansible#37191
Link: https://bugzilla.opensuse.org/show_bug.cgi?id=1084525
@alxgu
Copy link
Contributor

alxgu commented Mar 9, 2018

Tested and LGTM
shipit

@ansibot ansibot added automerge This PR was automatically merged by ansibot. shipit This PR is ready to be merged by Core and removed community_review In order to be merged, this PR must follow the community review workflow. labels Mar 9, 2018
@ansibot ansibot merged commit 5234b78 into ansible:devel Mar 9, 2018
hwoarang added a commit to hwoarang/ansible that referenced this pull request Mar 9, 2018
When looking for installed packages we do not need to query
repositories since we only care about the rpmdb. As such, we can
disable all the repositories operations in order to improve the
performance of that step

Before this patch, when using 'state: present' in the zypper module,
the operation was taking about 12 seconds to complete:

time ansible-playbook foo.yml 1>/dev/null

real	0m12.614s
user	0m10.880s
sys	0m0.683s

After this patch:

time ansible-playbook foo.yml 1>/dev/null

real	0m4.193s
user	0m2.560s
sys	0m0.575s

see:
https://bugzilla.opensuse.org/show_bug.cgi?id=1084525
(cherry picked from commit 5234b78)
hwoarang added a commit to hwoarang/ansible that referenced this pull request Mar 9, 2018
When looking for installed packages we do not need to query
repositories since we only care about the rpmdb. As such, we can
disable all the repositories operations in order to improve the
performance of that step

Before this patch, when using 'state: present' in the zypper module,
the operation was taking about 12 seconds to complete:

time ansible-playbook foo.yml 1>/dev/null

real	0m12.614s
user	0m10.880s
sys	0m0.683s

After this patch:

time ansible-playbook foo.yml 1>/dev/null

real	0m4.193s
user	0m2.560s
sys	0m0.575s

see:
https://bugzilla.opensuse.org/show_bug.cgi?id=1084525
(cherry picked from commit 5234b78)
openstack-gerrit pushed a commit to openstack/openstack-ansible-tests that referenced this pull request Mar 14, 2018
Similar to the CentOS case, we should use 'present' instead of 'latest'
for the package state so we don't spend time resolving dependencies,
querying repos etc. The 'present' state can be further improved either
in the zypper itself or in the Ansible module.

Change-Id: I44fae44030af1c9ee88dcc26c6b55c91a2531926
Link: ansible/ansible#37191
Link: https://bugzilla.opensuse.org/show_bug.cgi?id=1084525
(cherry picked from commit 1f2ab67)
openstack-gerrit pushed a commit to openstack/openstack-ansible that referenced this pull request Mar 15, 2018
Similar to the CentOS case, we should use 'present' instead of 'latest'
for the package state so we don't spend time resolving dependencies,
querying repos etc. The 'present' state can be further improved either
in the zypper itself or in the Ansible module.

Link: ansible/ansible#37191
Link: https://bugzilla.opensuse.org/show_bug.cgi?id=1084525

Change-Id: I8a6598013714e468d19f4984288d2c746515b5ca
nitzmahone pushed a commit that referenced this pull request Apr 9, 2018
When looking for installed packages we do not need to query
repositories since we only care about the rpmdb. As such, we can
disable all the repositories operations in order to improve the
performance of that step

Before this patch, when using 'state: present' in the zypper module,
the operation was taking about 12 seconds to complete:

time ansible-playbook foo.yml 1>/dev/null

real	0m12.614s
user	0m10.880s
sys	0m0.683s

After this patch:

time ansible-playbook foo.yml 1>/dev/null

real	0m4.193s
user	0m2.560s
sys	0m0.575s

see:
https://bugzilla.opensuse.org/show_bug.cgi?id=1084525
(cherry picked from commit 5234b78)
abadger pushed a commit that referenced this pull request Apr 9, 2018
When looking for installed packages we do not need to query
repositories since we only care about the rpmdb. As such, we can
disable all the repositories operations in order to improve the
performance of that step

Before this patch, when using 'state: present' in the zypper module,
the operation was taking about 12 seconds to complete:

time ansible-playbook foo.yml 1>/dev/null

real	0m12.614s
user	0m10.880s
sys	0m0.683s

After this patch:

time ansible-playbook foo.yml 1>/dev/null

real	0m4.193s
user	0m2.560s
sys	0m0.575s

see:
https://bugzilla.opensuse.org/show_bug.cgi?id=1084525
(cherry picked from commit 5234b78)
@dagwieers dagwieers added the packaging Packaging category label Mar 3, 2019
@ansible ansible locked and limited conversation to collaborators Apr 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
automerge This PR was automatically merged by ansibot. feature This issue/PR relates to a feature request. module This issue/PR relates to a module. new_contributor This PR is the first contribution by a new community member. packaging Packaging category performance shipit This PR is ready to be merged by Core support:community This issue/PR relates to code supported by the Ansible community.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants