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.
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
http://technet.microsoft.com/en-us/sysinternals/bb896645
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.
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.