title: asp.net high number of Request Queued and Context switching
body: <p>We have a fairly popular site that has around 4 mil users a month. It is hosted on a Dedicated Box with 16 gb of Ram, 2 procc with 24 cores.</p>
  
  <p>At any given time the CPU is always under 40% and the memory is under 12 GB but at the highest traffic we see a very poor performance. The site is very very slow.  We have 2 app pools one for our main site and one for our forum. Only the site is being slow. We don't have any restrictions on cpu or memory per app pool.</p>
  
  <p>I have looked at he Performance counters and I saw something very interesting. At our peek time for some reason Request are being queued. Overall context switching numbers are very high around 30 - 110 000 k.</p>
  
  <p>As i understand high context switching is caused by locks. Can anyone give me an example code that would cause a high number of context switches.</p>