Matt Briggs
Matt Briggs

Reputation: 42158

Is ASP.net WebForms a CPU intensive platform?

I work in an asp.net shop, and I heard today that the bottleneck on our servers is CPU. I had always thought that webapps tended to be I/O and network bound before CPU. Is this an ASP.net/IIS thing? Is it our code? Or am I just completely wrong about the whole thing?

Also, we do public facing social/commerce sites using webforms. It is not that the CPU load is a problem or anything, our servers can currently handle the load. I just found it suprising, since from what I understand about web applications, most of the time CPU is not the issue when it comes to scaling, especially on a compiled language with a fast runtime like .NET.

Upvotes: 4

Views: 871

Answers (7)

gjutras
gjutras

Reputation: 764

Run a profiler to see if there are areas in your application that use too much cpu, or ridiculous amounts of memory. Use task manager on the server and see if it is IIS (inetinfo and w3wp) that is running away and not some other process. If it is IIS find out if it's your application pool that is running away. use iisapp command to find which app pool is assigned to which worker process.

Upvotes: 0

Akash Kava
Akash Kava

Reputation: 39916

If you are talking about CPU intensive, its quite relative term, however .NET is not but ASP.NET is very much. Web Apps doing thousands of postbacks and recreating/destroying controls on every request is quite expensive.

Think of it this way, in pure ASP.NET (non ajax ones, the old ones) calculate visibility/color.. all attributes of every element of html page for 1000s of users only on server and distribute them to clients. Not only that badly written ASP.NET Server Controls eat up more CPU as they do too much calculations.

To improve ASP.NET performance, more AJAX should be used or RIA like Flex/Silverlight will drastically reduce CPU overhead because you can use client's CPU to do your Data Visualization.

RIA Client (Flex/Silverlight) + ASP.NET Web Services is the future, I dont have detailed statistics to share but we moved away from ASP.NET almost a year back and our CPU usage has been reduced to 18% average from 99% before RIA based web sites.

Upvotes: 0

mcjabberz
mcjabberz

Reputation: 9998

If you have slow hardware, yes. For most modern servers, no. The database will tax your CPU much more in most cases.

Upvotes: 0

womp
womp

Reputation: 116977

It's most likely your code. You can't categorically state anything about ASP.Net here, it's just like any other computer program - it is totally dependent on what your application is actually doing.

There is nothing inherently CPU intensive about serving up web pages. I've seen a laptop running IIS serving 1200 page requests per second. Although it is true that ASP.Net is more configured for "ease of use" out of the gate rather than optimal performance, it's not too hard to tweak it for great performance.

You can use a profiler such as Dottrace or RedGate Ants to see where your code is slowing everything down.

Upvotes: 3

Bob Kaufman
Bob Kaufman

Reputation: 12815

While at first blush, I'd say "I/O intensive, of course", the truth is that it depends on what your application is serving.

At one extreme, a multimedia server would, of course, be I/O bound.

At the other, a calculation intensive site that serves up rather plain text-only HTML pages would be CPU bound.

In my experience, I've found that most sites are I/O bound. That is, when additional servers are purchased, it's to increase I/O rather than CPU throughput. I'd go so far as to say that even the most elaborate site I've worked on, which had about thirty servers, would have been well served by a single processor. It was network bandwidth that directed our purchases.

Upvotes: 1

Nick Berardi
Nick Berardi

Reputation: 54854

It is your code. There is nothing inherently CPU intensive about ASP.NET, and I would actually call in to question the research that was done for saying the CPU was the bottleneck, because unless you are calculating Pi out to the billionth decimal point on your web application, I see no reason what could be eating up all that CPU time.

Upvotes: 6

kemiller2002
kemiller2002

Reputation: 115420

I would look at the code to see if there are performance issues. This site serves almost 1 million pages a day and seems to be doing fine. Asp.net is pretty optimized for scalability when written to do so.

Upvotes: 1

Related Questions