The load balancing concept has been developed in order to achieve an optimum distribution of tasks across the available user kernel threads. This enables the database system to use its resources more effectively, particularly on computers with multiple processors, which leads to shorter response times for individual users.
Load balancing is possible for database instances from Version 7.4.03.
The operating system cannot influence how the database system tasks are distributed across the available user kernel threads. This means that it cannot intervene if a user kernel thread is using a processor to its full capacity, while, for example, the other three processors on a computer are not being used at all.
Generally, tasks display cooperative behavior in a user kernel thread. The tasks decide when to suspend themselves and let the next waiting task run in the same user kernel thread. This behavior means that a single task can block all other tasks in the same user kernel thread for a long time.
When load balancing is activated, the timer thread coordinates the distribution of the tasks across the individual user kernel threads. At regular intervals, the timer queries how long the individual tasks have been waiting in the user kernel threads, and calculates the total waits for each user kernel thread.
If the total of the waits in a particular user kernel thread is a lot larger than in another thread, the timer ensures that the task that has been waiting the longest is moved to this other thread.
User kernel thread UKT1 contains the tasks T1, T2, T3; user kernel thread UKT2 contains the task T4. T1 is in a long-running loop, while T2 and T3 are waiting.
The total of the waits in UKT1 is 210 ms, whereas the total of the waits in UKT2 is only 10ms. T2 has been waiting the longest in UKT1, and is moved to UKT2 accordingly.
To activate load balancing, set the special database parameter LOAD_BALANCING_CHK to a value greater than zero.
See also:
Database Manager GUI, Displaying and Changing Database Parameters
Database Manager CLI, Changing the Value of a Database Parameter