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

Saltclass performance #48167

Closed
max-arnold opened this issue Jun 17, 2018 · 4 comments
Closed

Saltclass performance #48167

max-arnold opened this issue Jun 17, 2018 · 4 comments
Labels
Bug broken, incorrect, or confusing behavior severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around
Milestone

Comments

@max-arnold
Copy link
Contributor

Description of Issue/Question

As noted in the #42349 (comment), the performance is significantly degraded

Setup

Amount of reclass files:

(salt-2018) user@otg ~/work/salt % find reclass/classes -type f | wc -l
     302
(salt-2018) user@otg ~/work/salt % find reclass/nodes -type f | wc -l
      74

Steps to Reproduce Issue

Salt 2017.7.0, reclass:

time salt-call --id example.com pillar.data > /dev/null
salt-call --id example.com pillar.data > /dev/null  2,09s user 0,74s system 84% cpu 3,349 total

Salt 2018.3.1, saltclass

time salt-call --id example.com pillar.data > /dev/null
salt-call --id example.com pillar.data > /dev/null  3,85s user 1,63s system 89% cpu 6,136 total

Almost 50% of the time is spent in get_class doing this over and over for each class

for root, dirs, files in salt.utils.path.os_walk(os.path.join(saltclass_path, 'classes')):
    for l_file in files:
        l_files.append(os.path.join(root, l_file))

get-class

By applying dirty hack (not suitable for PR) I was able to cut run time from 6,136 to 3,456 seconds:

optimized-get-class

How to get these graphs:

python -m cProfile -o salt.profile ~/.virtualenvs/salt-2018/bin/salt-call --id example.com pillar.data
pyprof2calltree -i salt.profile -o callgrind.calltree

Then use qcachegrind or kcachegrind to open callgrind.calltree

Versions Report

salt --versions-report Salt Version: Salt: 2018.3.1

Dependency Versions:
cffi: Not Installed
cherrypy: Not Installed
dateutil: Not Installed
docker-py: Not Installed
gitdb: Not Installed
gitpython: Not Installed
ioflo: Not Installed
Jinja2: 2.8
libgit2: Not Installed
libnacl: Not Installed
M2Crypto: Not Installed
Mako: Not Installed
msgpack-pure: Not Installed
msgpack-python: 0.5.6
mysql-python: Not Installed
pycparser: Not Installed
pycrypto: 2.6.1
pycryptodome: Not Installed
pygit2: Not Installed
Python: 2.7.15 (default, May 2 2018, 00:53:27)
python-gnupg: Not Installed
PyYAML: 3.11
PyZMQ: 17.0.0
RAET: Not Installed
smmap: Not Installed
timelib: Not Installed
Tornado: 4.5.3
ZMQ: 4.1.6

System Versions:
dist:
locale: UTF-8
machine: x86_64
release: 17.6.0
system: Darwin
version: 10.13.5 x86_64

@Ch3LL
Copy link
Contributor

Ch3LL commented Jun 19, 2018

ping @olivier-mauras mind taking a look here?

@Ch3LL Ch3LL added the Pending-Discussion The issue or pull request needs more discussion before it can be closed or merged label Jun 19, 2018
@Ch3LL Ch3LL added this to the Blocked milestone Jun 19, 2018
@olivier-mauras
Copy link
Contributor

Yep got benchmarks and PR coming up let me clean it all up

@Ch3LL Ch3LL added Bug broken, incorrect, or confusing behavior severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around P2 Priority 2 and removed Pending-Discussion The issue or pull request needs more discussion before it can be closed or merged labels Jun 21, 2018
@Ch3LL Ch3LL modified the milestones: Blocked, Approved Jun 21, 2018
@ketzacoatl
Copy link
Contributor

great to see the improvements, definitely interested in using saltclass when its ready for action!

@twangboy
Copy link
Contributor

twangboy commented Sep 6, 2023

Closing this issue due to age and lack of activity. Please test this on version 3006.2 and create a new issue if the problem persists. The new issue template has more information and will allow us to track and reproduce the issue more effectively. Thanks!

@twangboy twangboy closed this as completed Sep 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug broken, incorrect, or confusing behavior severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around
Projects
None yet
Development

No branches or pull requests

6 participants