Jump to content
Flobberknock

How script distribution works

Recommended Posts

Hey guys 

I wanted to understand better how the “Distribute scripts over X” worked and was lucky enough to get an answer from the dev team, so here it is! 

 

 

First question: Distribute scripts over time.  

 

This is all handled by the database agent.

What we do is:

 

1) Calculate the spread in seconds 

 

In your example 6000 agents over 6 hours converts to 21,600 seconds

21,600 / 6000 = 3.6 seconds. This is the script interval

 

2) Queue the scripts including appending the incrementing script interval to the schedule time

 

 

3) We then pull items from queued scripts and put them into running scripts based on the timestamp and the current time.

 

HOWEVER, that does not mean they will run in an exact 3.6 second incremental order. One of the reasons is our max running scripts count. If other scripts are running and we are at our limit that can and will delay the scheduling of additional scripts. We also need to take into account how long these scheduled scripts take to complete. Because of this we may start out with a stagger of 3.6 seconds but it may grow into many minutes.

 

Second Question: Online/Offline is not taken into consideration at time of scheduling, all offline agents will be staggered. Offline agents are not addressed until step 3, when we pull from pending to running. We will skip that agent if it is set to skip offline and it will be removed from the queued scripts unless it is repeating script.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×