ASP.NET application and CPU usage

1.8k views Asked by At

We have a vanilla ASP.NET application (ASP.NET web forms, Entity Framework, SQL Server 2005) without any explicit multithreading from code. It has been deployed on the stagging environment (OS - Windows Server 2008 R2 64 bit, CPU - Intel Xeon E5507 @ 2.27 GHz 2.34 GHz, RAM - 7.5 GB). This environment is composed of a web, a database and a reporting server each a separate instance in the cloud (Amazon EC2). When testing for concurrency, observations are as under:

1 user - CPU usage ~25%, Response time 2-4 seconds

2 users - CPU usage 40-50%, Response time 3-6 seconds

4 users - CPU usage 60-80%, Response time 4-8 seconds

8 users - CPU usage 80-100%, Response time 4-10 seconds

My questions are:

  1. Is CPU usage is relative to no. of concurrent users? And the response time can vary to a great extent as seen in the above observations?

  2. As from the above observations, CPU will be maxed out when concurrent user counts is ~10. Shouldn't the CPU handle much more concurrent users seamlessly without a drastic increase in the response time? In ideal scenario, in case of a basic ASP.NET application, how many concurrent users a CPU can handle?

  3. If yes in the above question, what could be the problem here for high CPU/long response time? What ways we should go ahead for effective debugging to find out bottlenecks in code/IIS settings?

PS: IIS settings (i.e. in machine.config) which have been changed:

    maxWorkerThreads = 100
    MinWorkerThreads = 50
    maxIOThreads = 100
    minIOThreads = 50   
    minFreeThreads = 176        
    maxConnections = 100
1

There are 1 answers

0
James Johnson On

The high CPU usage could be caused by a wide variety of things. The easiest way to find out what's going on is to use a profiling tool:

ANTS Memory Profiler:
http://www.red-gate.com/products/dotnet-development/ants-memory-profiler/

ANTS Performance Profiler:
http://www.red-gate.com/products/dotnet-development/ants-performance-profiler/

They're very affordable, but you should be able to work unrestricted with the trial versions. These tools do a fantastic job of identifying bottlenecks and memory leaks.