What kind of performance can one expect from Microsoft IIS/VB.NET?

Folks:

I’d like to spec out the required front-end server hardware for a database application with the following characteristics:

  • Oracle server in the back end with at least 30 CPUs (existing machine; not sure how many cores in each CPU) and a lot of RAM
  • Microsoft IIS/VB.NET Active Server Pages for the front-end computers (with load balancer)
  • typical user session includes roughly the following workflow (let’s say 6 pages total)
    1. authenticate
    2. query Oracle to get enough information to build a form
    3. upon receiving the submitted form, send as many as 30 insert statements to Oracle

During a peak period we could conceivably get as many as 45,000 users logging in during a 30 minute period so that’s 270,000 pages to be served within 30 minutes or roughly 150 pages per second (corresponding roughly, perhaps, to the peak load on a server handling 4.5 million pages per day with a slightly uneven demand).

Let’s assume that Oracle is sufficiently well tuned and supported by hardware that it responds to all of these queries and transactions very quickly and does not become a bottleneck. (I recognize that this is a big assumption, but I would like to treat any Oracle issues in a separate posting.)

Here are my questions:

  1. what is the best way to configure IIS/.NET to maximize database performance? The database won’t be doing much else during these peak periods and my assumption is that there is no advantage to having more simultaneously connected Oracle users than the number of CPU cores on the Oracle server. Does that make sense?
  2. what kind of load can a $2000 Windows server support? The real work in this application is being done by Oracle on the monster Unix box in the middle. So all that the Windows server would have to do is interpret the Active Server Pages, manage a pool of database connections, and send complete pages back to users via HTTPS (note the SSL component). How many SSL pages per second would you expect the machine to be able to deliver? [For concreteness, I priced up a Dell R510 with dual Intel Xeon E5630 (2.5 GHz; 8 cores total from the two chips) and 16 GB of RAM. It came out to $2000 (admittedly with no disk or OS, but I guess you can’t have everything for $2000!). Anyway, let’s assume 8 cores and 16 GB of RAM.]
  3. Is it easy to configure the latest version of IIS/.NET to open no more than, say, 8 connections to the DBMS?

Thanks in advance to the Windows/IIS/ASP.NET heroes who answer!

[Note: This was edited down from a posting that had some distracting stuff about tuning Java, which resulted in a very unfocused discussion. I have had the moderator remove the non-IIS/ASP comments and will save them for a later posting regarding Oracle/Java.]

13 thoughts on “What kind of performance can one expect from Microsoft IIS/VB.NET?

  1. Before they do anything else they need to have repeatable tests that produce quantifiable and stable performance measures.

    At the very least they need these reliably quantify the performance issues before making any changes to the site. Without a test that reliably produces a stable quantifiable result they won’t be able to tell what sort of impact their changes are having. On the plus side you could even do this for them without having any kind of remote access as long as they don’t mind you hammering their site a certain times, or they have a development system that also exhibits the behavior.

    Having reliable tests with quantifiable results will make it possible to ask the performance related questions that have to be answered if you want to fix the existing infrastructure/site vs. just replace the core pages.

    Something like http://loadstorm.com/ might be of use. This is an external service that will put load on their servers. I’ve never used it as I prefer to use my own hardware and tools such as http://jakarta.apache.org/jmeter/ but perhaps they might find it appealing.

    A bit of googling turned up something that seems like it might be appealing to people familiar with VB and Windows:
    http://en.wikipedia.org/wiki/QTP
    “It uses the Visual Basic Scripting Edition (VBScript) scripting language to specify a test procedure, and to manipulate the objects and controls of the application under test.”

    It seems like this might be the same product? or a version of it? and available as a “cloud” service that might be more attractive if they are interested in such things:
    http://www8.hp.com/us/en/software/software-product.html?compURI=tcm:245-936943

  2. > IIS/.NET smart about minimizing the number of simultaneously
    > open connections to the RDBMS?

    Yes. ADO.Net (the .NET framework’s database access components) does very efficient connection pooling by default.

    > what kind of load can a $2000 Windows server support?

    A lot. Three years ago we had cheapish Windows / IIS 7 servers that would easily each handle a million page views a day, all making several requests to the database. You really had to be trying to get a dual proc dual core machine over 5% CPU usage.

    I’ve never seen IIS have any performance penalty for SSL. With the hardware you have described I cannot imagine that you will have any problems in the web server side.

    > Suppose that the DBMS is the bottleneck and Oracle is
    > responding very slowly to queries and inserts. When new
    > requests come in, will IIS/.NET by default look at all of the
    > blocked database connections and say “Since all of the db
    > pool connections are busy, this would be a great time to
    > open up some more”?

    Yes. When your code goes to access the database, it asks connection pooling if any connections are available. If not then it will open a new one and add it to the pool.

    When the number of connections hits the configured limit, the requests will be queued until an existing connection is freed up.

    > Is it easy to configure the latest version of IIS/.NET to open no
    > more than, say, 8 connections to the DBMS?

    Yes. I think default max connections is 100. You configure it in the connection string you use to tell .NET how to connect to the database.

    I would start with the default max and only reduce it if you have to. Again, .NET is very good at sorting this stuff out on its own.

    For more info see http://msdn.microsoft.com/en-us/library/8xx3tyca(v=vs.71).aspx

  3. Phil,

    VB.NET, IIS, and Oracle are not going to be your bottle-necks. 99% of the time this kind of symptom is related to bad code in the system and most of those times specifically related to bad database access code such as not properly releasing database connections. You’ll be able to see this specific issue occur by watching the number of connections in the connection pool (via Performance monitor tool). Regardless of how large the connection pool is, if you don’t properly release the connections in the code when you are done with them, you WILL run out of them, and then the system will slow to a crawl as the code waits for connections to free up when they finally time out.

    See this for more details on how to close them: http://discuss.joelonsoftware.com/default.asp?dotnet.12.339004.10

    Jim

  4. For your IIS/.NET queries:
    We use an IIS/VB.NET front-end for a reporting server that hooks up to a claims database. The reporting server is a hunk of junk, years out of date, but about 400-ish users connect through a website, running queries against a 200m+ row table, all pretty much at lightning speed.

    We have a second reporting system that goes with the engine described below that is also on Windows over IIS, written in C#. Results are roughly on par with the home-brewed VB.NET site we run. If there are any issues, it’s the software, not Oracle and its AIX box nor the Windows box that runs the website users connect to (i.e., the website loads pages slowly because its not very good, but all the actual processing and underlying connections were accomplished quickly).

    It’s absurdly easy to set up basically any type of connection with .NET.
    http://www.connectionstrings.com/oracle

    More pertaining to the “issue”:
    Another claims system we support runs an “engine” (a third-party product written in Java), running on Windows, connecting to an Oracle server. I suppose it’s only one connection but runs millions of queries against the database for hours while running, outputting millions of rows into quite about 30-ish tables (not all tables have a million inserted rows, some have up to 40 million). The load to Oracle is pretty minimal even if the engine’s processing causes the Windows CPUs to crawl. The only problems ever encountered are with the engine, not Oracle.

    I’m with the camp that the Java code itself is responsible for the slowups. Through hearsay, most of the biggest complaints I hear about through friends working at my company are Java connection issues.

  5. Hi, I work for the Microsoft Web Platform and Tools team. Feel free to email me or give me a call if I can help. ASP.NET, IIS and .NET in general scale pretty amazingly. I know that StackOverflow does about 100M PV a month on 6 modest machines (with SSDs, though). Depending on how cacheable your data is (versus totally real-time, which is unusual) you can likely do this in a straightforward way.

    It’s not easy to say “what kind of perf can you get for $2k” because it depends on what you’re doing (reads vs. writes, cpu heavy, threading, i/o threads vs. thread pool threads). That’s like asking me how many algebra problems can I do in an hour vs. how many calculus. It depends, as I scale differently. 😉

    That said, 16 gigs of RAM and a fast disk should get you a few thousands concurrent users and you should be able to fill 100Mb pipe easily.

    Give me a call if you want to speak to the team.

  6. From my limited (mostly second hand) experience with IIS/ASP there really is nothing between the performance of that and Java (or PHP, or AOLServer for that matter) per se.

    It’s all in the app. I feel quite ashamed of the attitudes of my fellow Java developers that more is more. If you have a problem, throw another layer on top of it! It quickly becomes a slow, buggy mess. Then they declare victory because of the great architecture.

    The same seems to be happening on .NET now.

    So I guess the reason you are not seeing your question answered is because it can’t be answered. A reasonably powerful (4 core modern CPU, few gigs of ram) running plain Java with JDBC and no Spring/EJB/JPA/Hibernate malarky will spit out thousands of pages containing several queries every second without breaking into a sweat.

    Same as an equally simple ASP or PHP page…

    (The PHP version may need some more optimising (bytecode caching, etc) than a standard install will have)

    Add a couple of layers of “frameworks” and your performance drops to a couple of hundred or less, much less. Misuse of those frameworks can easily lead to the kind of iterated queries slowing it to a crawl much like you had with your Ruby-off-the-Rails example you had last year.

  7. Answering question “#2”:

    http://www.spec.org/web2005/results/res2006q4/web2005-20061117-00057.html
    http://www.spec.org/web2005/docs/faq.html

    The test results above are from the 4th Quarter of 2006 and for Linux but they seem to match up fairly well with the hardware you mentioned: (Dell, 8 cores, 4 cores per chip)

    This seems to indicate that the hardware itself is in the ballpark and it seems to have been capable of handling 33,250 simultaneous user sessions (using SSL). They had a non trivial disk subsystem and 2x as much RAM however.

    Peter

  8. Peter: I don’t believe that 33,250 users can happily share a server that is only slightly more powerful than my desktop computer. I’m looking for real-world numbers that include a computer that has been coded by average programmers trying to solve a problem rather than trying to dominate a benchmark.

  9. Following up on Scott Hanselman’s comments about Stack Overflow (I love that site!):

    1. They use hardware very close to what you’ve specified.
    2. They hit peaks of 4 million page views per day
    (you suggested 4.5, with uneven demand).
    3. They have 10s of thousands of “active” users
    (somewhat difficult to judge, one can use anonymously)
    4. They are read/write
    (questions are submitted, as are answers, these are writes into a database).
    5. They use IIS and ASP.NET.
    6. They don’t appear to use SSL.

    Depending on how you count it they either use 3 web servers very similar to what you specified, or they use 10. I think it’s three and the other 7 are used for the other stackexchange sites but that’s just a guess. So, again, that hardware is in the ballpark range of what you’d need. As someone else previously mentioned it may not be possible to give you an exact answer as all web apps vary.

    This blog post by StackOverflow folks might be of interest given that you’re thinking of going with Dell hardware. It appears some BIOS changes might be a good idea. http://blog.stackoverflow.com/2010/10/database-upgrade/

    The hardware and software of stack overflow: http://meta.stackoverflow.com/questions/10369/which-tools-and-technologies-build-the-stack-exchange-network

    Hitting peaks of 4 million page views per day: http://www.quantcast.com/stackoverflow.com

    As of January last year there are 31,000 “active” users: http://meta.stackoverflow.com/questions/37395/how-many-users-does-stack-overflow-currently-have

    Some other stats from StackOverflow itself:
    http://api.stackoverflow.com/1.1/stats

    “questions_per_minute”: 3.13,
    “answers_per_minute”: 5.60,
    “views_per_day”: 855841.85,

    Peter

  10. Peter’s Analysis is spot on. One note. I spoke to SO at the Mix Conference and they have 10 servers, of which 6 run StackOverflow proper.

  11. If the 6 that SO mentioned at Mix include the two dedicated to SO database servers (each with 6 RAID 10 drives) we might want to cut that count down to 4.

    I think Phil was only interested in the web tier, for now. 🙂

    Very impressive either way. Great site. I’ve never seen it be anything other than immediately responsive.

    Peter

  12. Phil,

    Others have already given you good advice on this topic, but I thought I’d recount a tale of a time when I experienced a particularly perplexing performance issue with IIS.

    With IIS and ASP.NET, the performance bottleneck is rarely the front-end; it’s almost always the database (or other external synchronous service such as Web Service, .NET Remoting, etc.)

    IIS, like other web servers, limits the size of the thread pool that processes incoming HTTP requests. For IIS with ASP.NET, the default is 20.

    If your ASP.NET code performs long duration database queries (and 20 INSERTs could very well qualify, especially if the affected tables have indexes), it’s possible that you will exhaust all 20 request handlers.

    The first symptom is that the performance of the website is very poor, but the CPU load on the web server is low: the request handlers are sitting around idle, waiting for a response from the database.

    You can verify that this is the situation by running PERFMON on the web server and monitoring the following Performance Counters:

    % CPU Utilization
    ASP.NET v2.0.50727 -> Requests Current
    ASP.NET -> Requests in Queue

    A healthy IIS set-up will have low CPU utilization and zero Requests in Queue.

    An IIS server that is suffering from thread starvation will have 20 Requests Current, hundreds of Requests in Queue, with less than 100% CPU load.

    There are two solutions to this problem:

    1) The quick and dirty way: In your IIS Application Pool configuration, increase the “Web Garden” parameter to more than 1. This essentially runs multiple copies of IIS on the machine. For example, running 2 Web Gardens will increase the number of request handlers to 40. I will generally increase the number until the CPU load approaches 80%, or thrashing begins.

    2) The right way: Re-write your code so that it employs asynchronous communication with external services. ASP.NET 2.0 and higher includes the ability to execute asynchronous queries against a MS SQL Server database (I bet the same capability exists for Oracle DB)

Comments are closed.