[RESOLVED]High traffic system: would you rewrite with asp.Net MVC, a more minimalistic framework, or no framework at all?

I am aware that stackoverflow runs on MVC. But when they selected MVC they were just starting out and development productivity was their prime concern to get something out the door as quickly as possible, so they chose the framework they were most familiar
with.

They had no idea their system would grow to have so much traffic.

Now that they have to carry this huge h/w and network infrastructure to support their voluminous traffic, the question is if they were to rewrite their system now, knowing their current infrastructure costs, would they still happily choose asp.Net MVC?

It’s easy to say just slap on a load balancer and a bunch of servers, and MVC will scale up as large as you like. That may be true, but it gets expensive. Each new server costs money per month.

If I’m looking at two approaches, and one has a maximum throughput twice that of the other, it will require (I know this is oversimplified, but… in theory) half the servers to run.

If you want to rewrite a large existing system, that you already know has high traffic, and you can find an approach which can cut your h/w infrastructure costs in half or more, it’s something to think about.

No one can say there is no overhead price to using asp.Net (MVC or webforms). To keep things general and productive for developers, a lot stuff has to go on in the framework, and that adds overhead, which translates into higher infrastructure costs.

So, what would you use to rewrite a large, heavily traffic’ed existing system? MVC, or a more minimalistic framework, or no framework at all approach?

Ideally you want to use a framework that’s been tried and tested. You also want compiled/managed code. That doesn’t leave a lot of choices. You can run MVC on Unix under mono which can help keep costs low, and the next version will run on other platforms
natively.

keym6

They had no idea their system would grow to have so much traffic.

Stackoverflow was set up with the intention of generating as much traffic as possible, so that they could generate as much money as possible.

keym6

Now that they have to carry this huge h/w and network infrastructure to support their voluminous traffic,

They also generate large revenues from the site.

keym6

So, what would you use to rewrite a large, heavily traffic’ed existing system? MVC, or a more minimalistic framework, or no framework at all approach?

in my professional life i fix perfomance problems in projects like 90% of the time. and personally i would say for a site like stackoverflow,

go with MVC (asp.net or ruby) with a mongodb dal. this should be able to handle a massive load without using too many resources. 

before I changed a site to a new framework, I’d use performance metrics to see what percent of the performance overhead the framework contributed. I’d assume that in stack overflow for example, the MVC framework is probably about 1% to 10% of the cpu overhead,
so switching to a framework that was twice as fast, would cut a server farm of 10, by maybe 1 server. 

your performance bottlenecks should be your application code, not the framework. if the framework is using too high a percent, then look at another framework. if your site is just static pages, then asp.net will add a high overhead. But if your site has
a fair amount of application code, then it makes more sense.

also the framework is a very small part of the performance problem, there is payload size, how many requests your pages requires, network bandwidth, etc. for example the main evil in web forms was the viewstate adding to the payload. turning viewstate off
(a standard for any high performance site), still left a residual payload. if after tuning this payload was a major cost, then switching framework might be an option.  

you should pick a different framework because you can deliver faster with it, manage the code changes better, and hire staff.

 

looking at stack overflow, their main performance problem should be storing, retrieving, searching and sorting the articles. the cost of the UI layer (MVC) should not even enter into it. because they have large payloads, network bandwidth is probably next
(or maybe first). 

also never under estimate opportunity costs. if switching frameworks saves a server (20 – 80k), but delaying projects by only 10% (even a small team will have a burn rate of 4-10K a day), you may be losing big.  

keym6

So, what would you use to rewrite a large, heavily traffic’ed existing system? MVC, or a more minimalistic framework, or no framework at all approach?

I’d find out where the bottlenecks are and target those.  Given the sites I am typically involved with which rely on a CMS, or an indexing solution, or database, or web services, or often all of the above, I doubt the time it takes MVC vs WebForms vs Something
else to serve up the html has any significant bearing on the performance.  The CMS I use comes with profiling tools that shows you the time it takes to render each component.  A component that does nothing, takes nothing.  At most you are hitting a database
though the heavily-cached CMS API and you’ll see milliseconds here and there.  Look at a component that retrieves a basket and computes discounts and taxes on the fly, or a component that instigates a search of relevant products using a REST API, or shows
the child items of the immediate page as a menu, and now you’re seeing hundreds of milliseconds.  If MVC vs webforms saves me 1ms, I don’t really care…I want to get those hundreds of milliseconds down to tens of milliseconds and framework alone isn’t going
to do that.

If you re-write an entire site thinking one presentation framework is going to give you noticeable results over another, then you’re heading for a very, very, very expensive disappointment.

The app code plays very little part in serving cached pages. It’s all framework. That’s why I am interested in the framework overhead. Our pages don’t change much so they are almost always served from cache (once initially created).

WebForms and MVC will use the same caching framework underneath, you just access it via different tags.

Leave a Reply