Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I want to make sure that my W2008R2 box has least possible interrupts and context switches on the CPU threads.

I have 4 cores / 8 HT threads CPU. I am running a single application which uses only sockets as IO device so the only HW interrupts I expect to be the networking.

However I want to minimize interrupts from the OS threads. I stopped most service I understand that are not necessary. But it was just my personal hunch.

I want to develop sound knowledge on what can be stopped and what cant, what parameters can be tweaked.

Also what and how shall I monitor to be sure I made right decision.

Just to describe the operation: the application is .NET very low latency application which is in production for 3 years and fairly stable. It uses very little CPU, has low number of GC, uses low RAM, uses a lot of socket comms, occasional disk IO (some application logging which is like 10 lines of text per minute... Application has 4 very important threads to run (but # of current physical threads in the perfmon is 44 for the app).

The only service I use outside the application is RDP.

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

You may want to take a broader approach and profile your system activity with a tool such as SysInternals Process Monitor. It will provide you details of the rather large amount of activity that is constantly occurring on Windows systems with only minimal perceived activity.

One particular source for a lot of activity is the registry. There are four buttons on the toolbar that enable you to filter by registry, file system, network activity, or individual processes & threads.

If you identify a process that is generating a lot of "noise" or superfluous activity, you can experiment with turning it down to see if that doesn't break anything.

It's worth mentioning that in Windows 7/2008 R2 processes now have i/o priority and memory priority. You may want to experiment with a tool such as Lasso to see if you can achieve measurable results. Note that it may not be possible to assign a higher i/o priority. I believe tools such as this work by adjusting down the i/o priority of other select background processes.

More information:

Process Monitor 3.01

share|improve this answer
thanks for the tip. i never heard about lasso. let me have a look. –  Boppity Bop May 26 '12 at 20:20
add comment

I want to develop sound knowledge on what can be stopped and what cant, what parameters can be tweaked.

With all respect, this is hogwash. Unless you have some real problem, you are fighting a battle for a 2$ or so maximum performance gain that is just not worth it. If this question is how p program efficient thread that is the wrong forum, and the wrong question - but THAT would be a worthy battle.

Most important is to get a decent net work card. Server grade. As this is what most servr boards have these days - unless you went cheap and cot a workstation board, you basically already are quite optimal.

Application has 4 very important threads to run (but # of current physical threads in the perfmon is 44 for the app).

Well, this could aebe a problem, but it is not a problem YOU can solve from an OS tuning perspective - find out why it has 44 threads, what they supposedly do. That is a programmer task and as I said - that MAY be worth it. But tuning the a 2% or so gain is barking the wrong tree. Greg's post is a very good example - he talks about registry access etc. - that RARELY matters and IF it matters it simply is a "programmer fucked up, have him fix the code" side, not a "how do I tune windows".

Btw., the 44 threads could be mostly dormant. Stuff like finalizer, gc threads, reserver threads for the work item pool that just wait until an item is queued.

share|improve this answer
your opinion here is off the money. is very good for an abstract app server in vacuum. is nothing to do with me. nothing is wrong. and everything is working fine. I want THE BEST performance. I am looking at different areas when I have time. Networking is optimised at best I could do.. I want to optimise threading. WHATS WRONG WITH IT? Thank you very much –  Boppity Bop May 26 '12 at 20:19
As I said - it is wrong because it WILL NOT WORK. Threads per se do not cost performance when they are idle, if anything thread context switches do cost. YOu are the guy tuning the alternator in a car to get optimum perfornace while it gets you zero. –  TomTom May 27 '12 at 3:40
I AM trying to avoid context switches as much as possible. this is the MAIN purpose of this question. –  Boppity Bop May 27 '12 at 12:45
Well, then start not running RDP, and understand that given your hardware and your software you soptimize zero - you have more cores than active threads, so context switches are irrelevant. When having tons of IO, get a good network card that ddoes do that without a lot of interrupts - all you can do. –  TomTom May 27 '12 at 16:11
Tom, I'd appreciate an advise rather than runt about hogwash... I dont know if I have enough CPUs. I said 4 important threads but there are obviously more including .NET own threads. Hence I want to minimize threads running by OS if they are NOT absolutely needed. This was the question - what could be safely shutdown. –  Boppity Bop May 27 '12 at 19:40
show 1 more comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.