1830864 Members
2548 Online
110017 Solutions
New Discussion

Time sllice and Ticks

 
SOLVED
Go to solution
Marcelo De Florio_1
Frequent Advisor

Time sllice and Ticks

How can i to see the time (in miliseconds) of time slice and ticks for each time slice ?

thanks

MDF
Marcelo De Florio
16 REPLIES 16
Wodisch_1
Honored Contributor

Re: Time sllice and Ticks

Hi,

the simplest way seems to be "SAM". Go to the "Kernel Configuration", then "Configurable Parameters" and towards the very end of the list you'll find "timeslice", the value and the explanation...
But don't change it - lots of problems ahead then :-(
My experience show advantages only rarely, and only for small changes (between 7 and 14), so stay with the default 10.

ANd NEVER, EVER use that mistaken "1" form the kernel template for database servers!

Just my $0.02,
Wodisch
A. Clay Stephenson
Acclaimed Contributor

Re: Time sllice and Ticks

On 11.11 you can do a kmtune or you can do a sysdef on all OS's. The value is displayed in units of 10msec. By the way, leave it at 10.
If it ain't broke, I can fix that.
James R. Ferguson
Acclaimed Contributor

Re: Time sllice and Ticks

Hi:

In addition to that already offered, see:

http://docs.hp.com/hpux/onlinedocs/TKP-90202/TKP-90202.html

If you are running any version of 11.x, use

# 'kmtune -l -q timeslice'

to interrogate your setting. 'sysdef' is appropriate for 10.20 may not be reliable for all parameters supported in 11.x releases.

Regards!

...JRF...
Marcelo De Florio_1
Frequent Advisor

Re: Time sllice and Ticks


I have a following value:

kmtune -l -q timeslice
Parameter: timeslice
Value: 1
Default: (100/10)
Minimum: -
Module: -

So my workload is DataBase Server, any recomendations.

Regards
Marcelo De Florio
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: Time sllice and Ticks

Yes, yours is set to 1; set it to 10. You are most likely the victim of the tuned parameter set for databases that stupidly set timeslice to 1. As the machine loads, it begins to do context switches and very little else. I have seen it cause semaphore problems and in one extreme case, a loaded box was missing keyboard escape sequences. The really stupid part is that despite years of complaints the parameter set is still out there but I keep hearing real soon now and it will be fixed.
If it ain't broke, I can fix that.
Marcelo De Florio_1
Frequent Advisor

Re: Time sllice and Ticks

Clay:
ok, The value of 1, what the meaning of this value ?

mean every milisecond context switch ocurrs ?

Thanks

MDF
Marcelo De Florio
A. Clay Stephenson
Acclaimed Contributor

Re: Time sllice and Ticks

The best definition of timeslice that I had ever heard was given by Stephen Ciullo - "It's the maximum number of ticks that a process ain't gonna get". What's the number of 10msec ticks less than 1? - zero. That's why setting it to 1 is especially bad; your process is an immediate candidate to be put to sleep. Almost without exception set it to 10 and leave it there; in all cases, a timeslice of 1 is very bad.
If it ain't broke, I can fix that.
Marcelo De Florio_1
Frequent Advisor

Re: Time sllice and Ticks

Clay:
So, one process can run until 100msec, when the value is 10 for timeslice ?

Regards

MDF
Marcelo De Florio
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?