views:

1159

answers:

11

Can somebody suggest a good solid book on scaling Asp.Net applications? One that could potentially scale to millions of users.

Some of the books listed here are pretty good (http://highscalability.com/book-store). They cover a range of techniques which can be used independently of the technology used.

What I was looking for is something specific to Microsoft world, from someone who went through all that pain (like myspace). This might cover some techniques on some of the stuffs like using distributed caching (velocity), doing away with established database practices like normalization etc.

I went through the MSDN stuffs, blogs but I guess nothing beats a good book huh.. Or, maybe I should wait for SSDS.

+9  A: 

I don't know of a book, I have always just learned off the internet. Then came this MSDN article by Richard Campbell and Ken Alstad and it is definitely a must read.

Dale Ragan
+9  A: 

Well, I can't give you a recommendation on books, but I can give you a few pointers from my own personal experience (Our team runs an e-commerce/Customer Portal site that gets 2 million+ unique visitors per hour).

Some Notes:

  • At this kind of load, we have to scale out. We currently run small cluster (13? I think) behind redundant F5 BigIP Load Balancers(http://www.f5.com/products/big-ip/). Hardware Load Balancers are great!
  • Because we are in a farm, the default ASP.NET Session provider is worthless, however because Session is pluggable, we were able to write out own session provider without changing any application code. This allows us to run a dedicated state server.
  • We heavily leverage robust (kind of) middle tier solutions, we use SAP/R3 for purchase and inventory management, and Tibco for the business tier for dealing with pre-existing customers. These applications run on their own farms, and for the most part communicate with us via SOAP.
  • We currently use two boxes dedicated to running SQL Server, this hosts just the catalog database, not the customer database, that database sits on a 32 machine farm.
  • The SQL Server databases are definitly a pinch point, and can easily overload and die during peak hours. Because of this we cache heavily on the application level. Our own entity framework will cache all stored procedure calls and avoids executing a call if there is one in the cache.
  • This Cache is built out on each application server independantly, as having a single cache server would just be a point of failure.
  • If we were to invalidate all of the caches at once, it takes about 15 minutes under our current traffic load to rebuild it completely just from customer usage. However, this spikes our SQL Servers to 100% cpu.
  • When we invalidate our cache, we do it one app server at a time, rolling each through during non peak hours.

That said, there is lots of room for improvement. We can further optimize our databases (They are nearly 100% read, so cached denormalized views are good option, so is additional clustered indexes).

We also have been working with our content team to lighten the actual page sizes. Some of our pages can be up to 500k, which is horribly in my opinion. We are also investigating using a CDN to serve all static content to free up our servers to handle just dynamic content.

Anyways, This just gives you a little window in the life that is large scale website programming, and hopefully I didn't scare you :D

FlySwat
2 million+ unique users per hour? = 48m a day which is 0.8% of the worlds population... I'm sorry but that doesn't sound right to me!
Kieran Benton
+1  A: 

@Jonathan - Do you put your ViewState in the database also or do you keep it in the page? We put the ViewState in the database to help alleviate the page size.

Dale Ragan
A: 

@Jonathan - Do you put your ViewState in the database also or do you keep it in the page? We put the ViewState in the database to help alleviate the page size.

We currently serve the ViewState in form. I've been contemplating this as part of our "Decrease Page Load" initiative, and I'd love to get some feedback on moving Viewstate, so I opened a new question:

http://stackoverflow.com/questions/48070/moving-viewstate-out-of-the-page

FlySwat
+2  A: 

@Jonathan - Good post. Some of the points are very valid, especially in the corporate world. What I was thinking of mostly was Web2.0 apps like Twitter, Flickr etc. How to build such applications for the web using MS technologies? Internet is a great resource but I was looking for some good bed-time reading. :)

Gulzar
Building Scalable Web Sites by Cal Henderson (lead developer of Flickr)
hmak
+4  A: 

"Improving .NET Application Performance and Scalability" from the Patterns and Practices Group inside Microsoft (http://msdn.microsoft.com/en-us/library/ms998530.aspx) It is available as a PDF (http://www.microsoft.com/downloads/details.aspx?familyid=8A2E454D-F30E-4E72-B531-75384A0F1C47&displaylang=en) and a real book. It's a little old but it does have some excellent specific to .net advice on the topic.

Hafthor
+3  A: 

Steve Souders High Performance Web Sites is an excellent resource for web application developers from all backgrounds. It is not specific to any language - instead it lays out key rules to follow when implementing a web application that needs to really scale and perform.

Most interestingly, it also presents his findings of how well the top ten sites on the web adhere to these rules. As he works at Yahoo!, it is not surprising that they score pretty well. MySpace and eBay (ASP.net iirc) don't do anywhere near as well...

Great read. Highly recommended.

serg10
A: 

If you want to see how things get at the end of the silly scale take a look at what MySpace does.

Quibblesome
+1  A: 

Might be a little late on this but here is a very good book from the CTO of PageFlakes. It covers lot of different things related to performance. Here is the URL:

http://www.amazon.com/Building-Web-2-0-Portal-ASP-NET/dp/0596510500/ref=pd_bbs_sr_1?ie=UTF8&s=books&qid=1222832569&sr=8-1

azamsharp
very good book. highly recommended.
Gulzar
A: 

The best book I've ever read regarding scaling web application is not a Asp.Net one, but is a must for all you web architects out there - Scalable Internet Architectures

joeysim
+3  A: 

I recently finished writing a book on this exact topic:

Ultra-Fast ASP.NET: Build Ultra-Fast and Ultra-Scalable web sites using ASP.NET and SQL Server

I have advised companies such as MySpace and eBay on scalability issues, and have built on that experience in the book.

RickNZ