[THIN] Re: Context Switches

  • From: "Braebaum, Neil" <Neil.Braebaum@xxxxxxxxxxxxxxxxx>
  • To: "'thin@xxxxxxxxxxxxx'" <thin@xxxxxxxxxxxxx>
  • Date: Thu, 13 Mar 2003 09:34:30 -0000

Bernd - the "two kinds of context switches" - really equates to one.

It really is just the OS switching from a user mode to kernel mode for a
process. When this occurs between two (pseudo) concurrent sessions, you have
to realise a certain degree of this is inevitable.

There is no discernable different in "types" of context switch, though.
Merely the cause.

If the OS switches / timeslices between user mode processes - you have to
realise and accept that in doing so, some kernel process activity will
occur. And to be fair, some user mode activity may well produce or spawn
some kernel mode activity.

There is no true distinction in the type of context switch - so it's a bit
unfair to say that MS don't differentiate or provide a mechanism to measure
this - there is no true difference. What matters is the cause.


> -----Original Message-----
> From: Bernd Harzog [mailto:Bernd.Harzog@xxxxxxxxxxx] 
> Sent: 12 March 2003 18:04
> To: thin@xxxxxxxxxxxxx
> Subject: [THIN] Re: Context Switches
> Let me add my two cents. There are as Ron said two kinds of 
> context switches. One kind occurs when the processor switches 
> between two user mode tasks. So, if Ron and I are both 
> running an application on the same server when the CPU 
> switches between doing work for Ron and work for me, that 
> causes a context switch. That is a GOOD context switch, 
> because it is indicative of the CPU doing what it is suppose 
> to do, which is move so rapidly between doing work for 
> different users that each user never notices. The second type 
> of context switch occurs when the CPU goes from user mode to 
> kernel mode, and then back again (two Context Switches). 
> These are BAD context switches, because when the CPU goes 
> into Kernel mode it blocks user mode operations and slows 
> everything down.
> So, you need to find out what kind of context switches you 
> are getting. Since MS does not do us the favor of breaking 
> them out, the only way to find out is to look at other 
> indicators of heavy Kernel Mode operations and see if they 
> are pegged as well. Try looking at pages/sec and page 
> faults/sec. If you see a heavy correlation between these and 
> the context switches you may have an indicator that it is 
> kernel mode related. If it is, call me, because I have 
> something new that I cannot talk about on the list that we 
> might want to discuss.
>  -----Original Message-----
> From:         Ron Oglesby [mailto:roglesby@xxxxxxxxxxxx]=20
> Sent: Wednesday, March 12, 2003 12:30 PM
> To:   thin@xxxxxxxxxxxxx
> Subject:      [THIN] Re: Context Switches
> Well context switches are really the processor switching 
> between tasks or going between user mode and kernel mode tasks.
> A lot of time I think this can be due to the TYPE of 
> application and what it does. I have a document 
> imaging/managing software at a client that will get the 
> context switches up in the 30 - 35,000 range with a low proc 
> queue and proc utilization at about 60%. This software uses a 
> tome of different types of databases (SQL, Oracle, and 
> something else) as different backend servers and is a little 
> graphic intense. The NICs, Memory, Disk, Proc all are still 
> ok, but every time we get these things up to 30,000 
> performance starts to degrade. Now of course this is 30,000 
> steadily, not spikes. And only 27-30 users on DL 360 G2's Of 
> course on the same hardware and builds I am hosting Office 
> apps for like 50 and 60 users with context switches not a problem.
> Anyway, haven't found a relief for it yet. Hoping hyper 
> threading has an effect on this.
> -----Original Message-----
> From: Schneider, Chad M. [mailto:CMSchneider@xxxxxxxxx]=3D20
> Sent: Wednesday, March 12, 2003 11:20 AM
> To: 'thin@xxxxxxxxxxxxx'
> Subject: [THIN] Re: Context Switches
> I know one really spiked, as the chart now shows the 125,000 marker.
> -----Original Message-----
> From: Ron Oglesby [mailto:roglesby@xxxxxxxxxxxx]
> Sent: Wednesday, March 12, 2003 11:02 AM
> To: thin@xxxxxxxxxxxxx
> Subject: [THIN] Re: Context Switches
> 100,000... Cooooool
> What type of hardware. DL 360s start to get slow at like 30,000
> -----Original Message-----
> From: Schneider, Chad M. [mailto:CMSchneider@xxxxxxxxx]=3D3D20
> Sent: Wednesday, March 12, 2003 10:50 AM
> To: 'thin@xxxxxxxxxxxxx'
> Subject: [THIN] Context Switches
> Any way to tell which app/apps are causing my large context 
> switch usage?
> My servers run high all day, some spikes over 100,000.

This e-mail and its attachments are intended for the above named 
recipient(s) only and are confidential and may be privileged.
If they have come to you in error you must take no action based 
on them, nor must you copy or disclose them or any part of 
their contents to any person or organisation; please notify the 
sender immediately and delete this e-mail and its attachments from 
your computer system.

Please note that Internet communications are not necessarily secure 
and may be changed, intercepted or corrupted. We advise that 
you understand and observe this lack of security when e-mailing us 
and we will not accept any liability for any such changes, 
interceptions or corruptions. 

Although we have taken steps to ensure that this e-mail and its 
attachments are free from any virus, we advise that in keeping 
with good computing practice the recipient should ensure they 
are actually virus free.

Copyright in this e-mail and attachments created by us belongs 
to Littlewoods. 

Littlewoods takes steps to prohibit the transmission of offensive, 
obscene or discriminatory material.  If this message contains 
inappropriate material please forward the e-mail intact to 
postmaster@xxxxxxxxxxxxxxxxx and it will be investigated. 
Statements and opinions contained in this e-mail may not 
necessarily represent those of Littlewoods.

Please note that e-mail communication may be monitored.

Registered office: 
Littlewoods Retail Limited, 
Sir John Moores Building, 
100 Old Hall Street, 
L70 1AB 
Registered no: 421258 

This Week's Sponsor - RTO Software / TScale
TScale increases terminal server capacity. 
Get 30-40% more users per server to save $$$ and time. 
Add users now! - not more servers. If you're using Citrix, 
you must learn about TScale!  Free 30-day eval:

For Archives, to Unsubscribe, Subscribe or 
set Digest or Vacation mode use the below link:

Other related posts: