FBSNG Scheduler has the following general features:
All these features are achieved using scheduling algorithms based on the idea of dynamic priorities.
Generally, section priority reflects the number of “smaller” sections started ahead of this section. The higher the section priority, the more chances it has to start comparing to sections with lower priorities. Queue priorities are used in similar way. Relative queue priority is growing as long as for some reason, the Scheduler starts sections from other queues, but not from this one. Queue priority goes down when sections do start from it.
FBSNG scheduling is not pre-emptive. That is why some other mechanism must be used to ensure guaranteed scheduling. This is what priority gaps are used for. They determine the moment when higher priority object (queue or section) is considered to be “stuck” due to resources being consumed by objects with lower priorities, and in order to “let it go” (start any section from the queue or start the section which has been waiting for too long time) it is necessary to “hold” other objects for a while, even though it may mean that for some time a portion of farm resources will remain unused.
FBSNG Administrator can control the behavior of the Scheduler by adjusting various parameters used to determine how priorities change over time.
FBSNG configuration includes the following parts:
The following queue parameters are used to control and customize FBSNG Scheduling behavior. They determine how queue and section priorities change over time.
The Scheduler currently does not use other queue parameters such as CPU and real time limits to choose next section to start.
See FBSNG Administration and Installation Guide for more details on configuration file format and FBSNG configuration procedures.
FBSNG Scheduler runs periodically, but not more often than once per 5 seconds. The following events may trigger the Scheduler to run.
While running, Scheduler repeats the following two steps until it cannot start any more sections. Both steps are described in more details below.
QPI and QPD parameters determine how relative queues priorities change every time the Scheduler starts new section. Normally, QPI parameter is set to 1, and QPD parameter tells the Scheduler how many sections from other queues should start after a section starts from a queue before the queue regains its relative priority.
As you can see, queue priority gap (QPG) is used to temporarily hold low priority queues until a section from the queue with highest priority can start.
The following algorithm is used to determine which section in the queue to start and how to update section priorities:
As you can see, generally, section priority never goes down. Section priority remains unchanged until it reaches “ready” state. The section priority goes up as other sections submitted later start “passing” the section because they require fewer resources to start. If a section priority is much higher than priorities of some other sections, lower priority sections are blocked until the high priority section starts.
It is recommended that FBSNG Administrator and users while configuring and using FBSNG Scheduler follow certain guidelines.
Long-term projects should be assigned one or more dedicated queues. The number of queues should be determined based on the following considerations:
· Separate queue should be created for every activity within the project that uses sections with similar resource requirements, resource consumption patterns and time duration;
· Separate queue or group of queues should be dedicated to an activity or repeating task within the project if it is desired to control resource distribution among the activities or tasks. Since FBSNG does not maintain accounting information on per-queue basis, if such information is desired, each task or project should be assigned separate process type.
For short-term projects, or project for which it is impossible or impractical to identify common tasks or activities with similar resource requirements, generic queues should be used. In this case this should be user’s responsibility to choose appropriate queue for every section.
The following are suggested solutions for common configuration problems. They illustrate use of various configuration parameters.
Goal: The farm is used for two projects. Most of the time only background project is active, and occupies all resources of the farm. Occasionally, jobs of the other project are submitted. It is desired to set up the farm in such a way that jobs of high priority project start as soon as possible, and as long as there are some pending jobs of the high priority project, background project jobs should not be started.
Solution: Two queues should be set up for two projects. High priority project queue should be assigned higher minimal priority (QPmin) than background project queue.
In case when background project jobs take fewer resources than jobs of the other process, in addition, QPG for high priority queue should be set slightly higher or equal to the difference between QPmin parameters. QPI of high priority queue may be used to further reduce initial start delay for jobs in the queue. In this case, QPI should be comparable to the difference in QPmin.
Example:
|
Parameter |
High priority queue |
Background queue |
|
QPmin |
5 |
0 |
|
QPG |
7 |
100 |
|
QPI |
3 |
1 |
Goal: There are two projects. Both projects use sections with similar resource requirements. Both project run constantly without long interruptions. It is desired that in average, at any time, 70% of resources are allocated to first project (project A), and 30% - to second project (project B). In case of equal resources allocated to each section of both projects, this is equivalent to the requirement that sections of project A will start more often than of project B. Relative starting frequencies should be around 70% and 30% for two projects.
Solution: Set a queue for each project (A and B). Set QPI of both queues to 1 and QPD according to the following formula:
QPD(A)/QPD(B) = share(B)/share(A)
QPG and QPmax for both queues must be much much greater than QPD.
Example:
|
Parameter |
Queue A |
Queue B |
|
QPmin |
0 |
0 |
|
QPmax |
100 |
100 |
|
QPG |
100 |
100 |
|
QPI |
1 |
1 |
|
QPD |
3 |
7 |
Generally, if QPI of all queues are set to 1, and all queues have sections with similar resource requirements and take almost the same time to complete, the shares of resources used by sections started from each queue are reversly proportional to queue’s QPD.
Goal: There are two projects, bulk and light. Sections of bulk project require considerably big number of resources, or use sections with bigger number of processes comparing to light project. Naturally, light project has advantage over bulk simply because light sections require fewer resources, and therefore have more opportunities to start. It is required however that bulk sections start as often as light sections even though it is impossible without having some portion of farm resources to remain “reserved” and unused for some time intervals.
Solution: Set up two queues, bulk and light. Use queue priority gap (QPG) to hold light queue until a section starts from bulk queue.
Example:
|
Parameter |
Bulk queue |
Light queue |
|
QPmin |
0 |
0 |
|
QPG |
1 |
100 |
|
QPI |
1 |
1 |
|
QPD |
1 |
1 |
Goal: The goal is the same as in the previous case, but for some reason, single queue has to be used for both bulk and light sections. It is required that bulk sections do not have to wait infinitely to start in presence of pending light sections. The goal is to start in average one bulk section per N light sections.
Solution: Use Section Priority Gap (SPG) to use employ guaranteed scheduling feature of the Scheduler. SPG for the queue should be set to N.
Goal: It is required to allocate fixed sets of worker nodes to some projects. It is acceptable that while certain project is idle, nodes assigned to it will remain unused.
Solution: Use node attributes to assign nodes to projects. Each node should be assigned one or more attributes corresponding to projects allowed to run there. Each project should be associated with its own process type. Attribute requirements should be entered into default resource requirements for process types. Note that if certain projects are allowed to share certain nodes, those nodes should be assigned more that one attribute.
See also “FBSNG Resources” document for more information.
Goal: It is required that certain projects are limited to certain number of resources used in the same time. It is not required to restrict project to use certain nodes. It is acceptable that while one or more projects are idle, some portion of farm resources remains unused.
Solution: In this case, individual process type should be assigned to each project. Resource allocation quotas should be defined to limit resource allocation for each process type. To avoid resource underutilization, project quotas can be defined so that farm resources are slightly over-booked.
See also “FBSNG Resources” document for more information on FBSNG resources.