Alachisoft.com
Download NCache Now!

LIVE Product Demos

Sign-up Now

Short Product Videos

Watch Now!

Contact Us

Follow Us


 DiggLinked InTwitterYou Tube

Improve ASP.NET Performance and Scalability

ASP.NET has become a very popular technology for developing web applications because of the ease of rapid development it provides through its rich set of development tools. As a result, more and more people are using ASP.NET in high-traffic situations. Seeing 10-20 server web farms is now a common thing and many companies have 100+ servers in a load balanced ASP.NET web farm.

ASP.NET Performance Problem

An ASP.NET application that is lightening fast with 10 concurrent users is no good if it grinds to halt with 1000, 10,000, or 100,000 concurrent users. Although, ASP.NET architecture itself scales very nicely by allowing you to deploy ASP.NET on a web farm, it is the fact that ASP.NET (like any web application) makes frequent but expensive database trips. And, this slows down ASP.NET performance as you grow the number of concurrent users or requests/sec. And, slow ASP.NET performance can mean that you will lose customers who do not have the patience for slow response times.

The reason for a slow-down in ASP.NET performance is because the database is not able to handle such large number of requests which a high-traffic ASP.NET application generates. ASP.NET relies on the database for storing and accessing application. And, for web farms, it also typically stores ASP.NET session state in the database.

So, although, the ASP.NET application scales nicely in a web farm, the database server becomes a bottleneck for ASP.NET performance.


Database becoming a bottleneck in ASP.NET performance

Figure 1: Database becoming a bottleneck in ASP.NET performance


ASP.NET Performance Solution: Distributed Cache

Now that we know what causes ASP.NET performance bottleneck, the question arises as to what needs to be done to fix this problem and improve ASP.NET performance even under peak loads? The answer to this problem is simple! You can remove these ASP.NET performance bottlenecks by using an in-memory distributed cache for storing all the data used by ASP.NET. The following data can be stored in a distributed cache:

  • ASP.NET Session State storage: By default, ASP.NET Session State is either stored in StateServer or SQLServer in a web farm. Both cannot handle the load. Therefore, you should consider storing your ASP.NET Session State in a distributed cache. It will provide and extremely fast access time and result in ASP.NET performance improvement. And, a distributed cache will also scale linearly just like your web farm and keep providing you excellent performance even under high-traffic situations.
  • Application data cache: Application data has to be stored in the database which is its master store. However, your ASP.NET application reads the same data multiple times and each time makes those expensive database trips. But,if you could cache this data, you would save all those extra read-trips to the database. And, this would relieve a lot of pressure from your database and allow it to performance fast. The end result is that you can grow the number of users for your ASP.NET application without degrading ASP.NET performance.

Session & Application data being stored in a distributed cache

Figure 2: Session & Application data being stored in a distributed cache


How Does Distributed Cache Scale?

Unlike a database server, a distributed cache can scale out into 10's or even 100's of cache servers clustered together. Just like a RAID disk divides and replicates data among multiple inexpensive hard drives, a distributed cache scales by dividing the entire cache into partitions and distributing them across multiple inexpensive cache servers. It then adds reliability by replicating each partition to at least one other server in the cache cluster. This way, even if a cache server goes down, no data is lost.

This allows a distributed cache to scale out and handle extremely large transaction loads. NCache does this through a caching topology called Partitioned-Replica Cache.


Partition-Replica Cache scales linearly but also replicates

Figure 3: Partitioned-Replica Cache scales linearly but also replicates


How Does NCache Help?

NCache is a feature-rich distributed cache that boosts ASP.NET performance and scalability. Here are some simple steps you could take to quickly benefit from it:

  • Install NCache: on your web servers and two cache servers
  • Create a cache: through a GUI based NCache Manager tool
  • Configure your web servers: to access this cache through NCache Manager
  • Modify ASP.NET web.config to use NCache: You only need to modify web.config of your ASP.NET application to start storing Session State in NCache. You can do this in a few minutes and see NCache in action
  • Cache application data in NCache: You will need to reference NCache assemblies and then make NCache API calls to store and fetch your .NET objects from the cache
  • Monitor ASP.NET performance: You can now monitor ASP.NET performance and also NCache performance. NCache provides a rich set of PerfMon counters for you to monitor with

What to Do Next?