1752794 Members
7422 Online
108789 Solutions
New Discussion юеВ

Time sllice and Ticks

 
SOLVED
Go to solution
harry d brown jr
Honored Contributor

Re: Time sllice and Ticks

MDF,

yes, 100ms, if it is a good process and doesn't get itself swapped out. And because it's a risc processor, every tick can execute (I stress can) many instructions, but the likelihood of a process consumimg all 100ms is slim - unless it's cpu bound.



live free or die
harry
Live Free or Die
keith persons
Valued Contributor

Re: Time sllice and Ticks

Actually, it is 10ms not 100, each clock tick is 1ms. And yes, each process may run for up to the value of timeslice provided the process does not need to wait for a resource (i.e. I/O from disk) or a higher priority process becomes runnable.

In the first scenario, the process will relinquish the processor voluntarily (voluntary context switch), in the latter it is a forced context switch. It is the forced context switching that literally destroys the functionality of the system when timeslice is set to 1.

In 10+ years of hp-ux support, I do not recall a single instance where timeslice set to 1 provided any benefit whatsoever.
Marcelo De Florio_1
Frequent Advisor

Re: Time sllice and Ticks

keith:
If the timeslice is 1ms when you configure timeslice to 1, then the operating system is spending a lot of time doing context switch (how much time a context switch takes in HP-UX 11.0 ?)

Regards.

MDF


Marcelo De Florio
A. Clay Stephenson
Acclaimed Contributor

Re: Time sllice and Ticks

The answer is, of course, it depends; in general, very quickly BUT the point of this is that with timeslice set to 1 the process is an immediate candidate for another context switch. Set this thing to 10 and forget it.
If it ain't broke, I can fix that.
keith persons
Valued Contributor

Re: Time sllice and Ticks

>If the timeslice is 1ms when you configure timeslice to 1, then the operating system is spending a lot of time doing context switch

Correct, a classic manifestation is low CPU util but extremely high percentage of system mode for processor util (i.e. 40% total cpu util but 70+% is system). Another common complaint is it takes a long time to login. Under these circumstances the processor is spending so much time in system mode (context switching processes reprioritizing processes) that user interrupt requests can get little if any cpu time at all.

>how much time a context switch takes in HP-UX 11.0?

To be honest, I don't know. However, even if it is a fraction of a millisecond, one clock tick is too little time for a user process to much of anything constructive and there seems to be little that can be done to clear the symptom.

The bottom line is timeslice should not be changed from the default (10) unless testing has verified beyond doubt a different value would be beneficial.
Tim D Fulford
Honored Contributor

Re: Time sllice and Ticks

Comming in on this super late!!!

You can see context switching using either MeasureWare or Glance. If you do not have neither of these then I do not know!

Very roughly...
2 types of context switching, forced & volantary. For a multi CPU machine I like to see for my busiest processes voluntary > forced. preferably very much greater than. If you have a single CPU machine... tough.

On the subject of timeslice. Stephen Culio & Doug Gruman suggest 10 (10ms) BUT if you feel brave I heard that 7-14 are also "acceptable". IF you are CPU bound setting it slightly higher may help as you reduce the ammount of context switching, IF not a lower value MAY help. I would try this out on a test machine first, or not bother! There are other things you could be doing that would be more productive (If it is a database tune the database etc)

Regards

Tim
-
Robert Dale Ware
New Member

Re: Time sllice and Ticks

Is there a difference between the timelice values of (100/10) and 10?