0

I'm trying out Saltstack 2015.08 on my openSUSE Tumblweed x86_64 machine. I have a trivial local setup which ends up installing a single package:

install_apache_2:
  pkg.installed:
    - pkgs:
      - apache2-doc

However, this takes 50 seconds, probably due to the zypper repositories being refreshed forcefully and a full rpm database scan being done twice

[INFO    ] Executing state pkg.installed for install_apache_2
[INFO    ] Executing command ['rpm', '-qa', '--queryformat', '%{NAME}_|-%{VERSION}_|-%{RELEASE}_|-%|EPOCH?{%{EPOCH}}:{}|\\n'] in directory '/root'
[INFO    ] Executing command ['zypper', '--non-interactive', 'refresh', '--force'] in directory '/root'
[INFO    ] Executing command ['zypper', '--non-interactive', '--no-refresh', 'install', '--name', '--auto-agree-with-licenses', 'apache2-doc'] in directory '/root'
[INFO    ] Executing command ['rpm', '-qa', '--queryformat', '%{NAME}_|-%{VERSION}_|-%{RELEASE}_|-%|EPOCH?{%{EPOCH}}:{}|\\n'] in directory '/root'
[INFO    ] Made the following changes:
'apache2-doc' changed from 'absent' to '2.4.23-1.1'

How can I speed up package installation?

Robert Munteanu
  • 1,542
  • 5
  • 22
  • 38

1 Answers1

0

I typically only see this on the first package then subsequent package installations are fast. This is due to the db refresh and data collection at the beginning of the run. Do an install of 2 or more packages at once to see the difference.

  • I agree the cost _per package_ will be lower once I get to more complex issues. But it's still an extra 50 seconds per run I'd like to avoid. – Robert Munteanu Aug 11 '16 at 10:00