HP-UX Reference (11i v3 07/02) - 5 Miscellaneous Topics (vol 9)

t
timeslice(5) timeslice(5)
(Tunable Kernel Parameters)
NAME
timeslice - scheduling interval in clock ticks per second
VALUES
Failsafe
(HZ/10)
Where HZ defines the number of clock ticks per second for which the system is configured.
Default
(HZ/10)
Where HZ is equal to 100.
Allowed values
Any value in the range of -1
to 2147483647 is allowed.
A value of
-1 indicates no timeslice based scheduling preemption, and threads will continue to run until
they voluntarily switch out or higher priority threads preempt them.
Recommended values
Use the default value in normal cases. In special cases where quicker round robin scheduling is required, a
value of 1 may be used. However, a change in value may have a direct impact on system performance.
Customers must evaluate performance impact in their workload environment before changing the value on
production systems.
DESCRIPTION
The timeslice tunable defines the scheduling time interval that a thread may execute on a processor
before the kernel scheduler will context switch out the thread for other same priority threads to run. When
a thread starts executing on a processor, the thread is set up to run for the number of ticks in the
timeslice tunable. On every clock interrupt that a thread is found executing, the time quantum bal-
ance for the thread is decremented, and when the balance reaches zero, the thread is context switched out.
The timeslice value controls one method of user preemption that the operating system implements. A
larger value will reduce preemption of running threads; however, there are other reasons for user preemp-
tion of threads, and the timeslice tunable has no control there.
A change in the timeslice value may have direct impact on system throughput and response times. A
very small value may result in too many context switches, and a very large value may result in the starva-
tion of runnable threads.
Who Is Expected to Change This Tunable?
Anyone.
Restrictions on Changing
Changes to this tunable take effect at the next reboot.
When Should the Value of This Tunable Be Raised?
Since the timeslice tunable is globally applicable to all threads (except sched_fifo) in the system,
irrespective of their scheduling policies and priorities. Any increase in value of this tunable will give equal
time quantum boost to all threads.
If the system has too many context switches due to preemptions, caused by higher priority threads, you can
raise the value to provide more time for lower priority threads to execute when they get scheduled, because
higher priority threads will preempt the lower priority threads when they become runnable.
What Are the Side Effects of Raising the Value?
Raising the value of the timeslice tunable may cause starvation of some threads, as they have to wait
longer for their turn to execute. This may cause performance throughput issues.
When Should the Value of This Tunable Be Lowered?
The timeslice tunable value should be lowered if better turnaround in response time is required at the
cost of additional context switches. When the system does not have too many compute intensive applica-
tions, threads will block and preempt much more frequently without utilizing their complete time quantum.
516 Hewlett-Packard Company 1 HP-UX 11i Version 3: February 2007