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

Feature request - add configurable scheduler random time slew to avoid simultaneous execution scenarios. #7324

Closed
eugenea opened this issue Sep 18, 2013 · 5 comments
Labels
Feature new functionality including changes to functionality and code refactors, etc. stale
Milestone

Comments

@eugenea
Copy link

eugenea commented Sep 18, 2013

Please make scheduler random slew configurable from scheduler config.
For example slew: 5%. This will be added/substracted to schedule interval to avoid simultaneous execution. THe initial slew for first execution should be 100% (i e random within execution interval).

@basepi
Copy link
Contributor

basepi commented Sep 18, 2013

Sounds good, thanks for the request.

@dangarthwaite
Copy link
Contributor

I took a stab at this during the saltconf sprint in salt/utils/schedule.py:

    class Schedule(object):
            [.... snip ...]
            # Add a random spread% seconds
            spread = int(data.get('spread', 0))
            if spread > 0:
                skew = random.randint(0 , int(seconds * spread / 100))
                log.debug("Spreading {0} seconds by {1} seconds".format(seconds, skew))
                seconds += skew

I think this snippet is being run early and often, resulting in many different skewed values. Someone suggested the calculated skew may need to be persisted in context.

@eliasp
Copy link
Contributor

eliasp commented Jan 11, 2015

Until this is implemented, this article outlines various approaches on how to distribute the load across the Salt infrastructure.

@The-Loeki
Copy link
Contributor

I think the current splay covers this? https://docs.saltstack.com/en/latest/ref/states/all/salt.states.schedule.html

splay
The amount of time in seconds to splay a scheduled job. Can be specified as a single value in seconds or as a dictionary range with 'start' and 'end' values.

@stale
Copy link

stale bot commented Feb 23, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.

@stale stale bot added the stale label Feb 23, 2018
@stale stale bot closed this as completed Mar 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature new functionality including changes to functionality and code refactors, etc. stale
Projects
None yet
Development

No branches or pull requests

5 participants