Dear readers,
Before we immerse ourselves into thoughts of ASP.NET Cache limitations, let’s explain worker processes, web gardens and web farms in a little more detail so that we can understand the issues of synchronization, speed, reliability and scalability in the context of caching. Doing so would not only help us realize the drawbacks that ASP.NET Cache entails but it will also make it possible for us to outline the situations in which one should contemplate using it or looking for alternative solutions.
Worker Process:
Worker processes help separate various applications running on one server. If one worker process fails or collapses, it does not affect the other applications that are running in separate worker processes. This makes the server environment stable without any drop in an application’s performance due to process separation.
Similarly, a single application can run in multiple worker processes that are all independent of each other. This provides reliability for the application in case one worker process gets corrupted. However, each worker process now contains its own instance of the Cache and you end up with multiple copies of the same cache on the same web server.
Additionally, worker processes do recycle by default although you can configure them not to. Once they recycle, any data in the process is lost. And, Cache housed inside of such processes is no different. This causes major issues which will be discussed in the next post in this category.
Web Gardens:
A Web Garden configuration means an application running in more than one worker process on a server. Having multiple worker processes provides reliability because if any one worker process gets corrupted, another one is available to service user requests. Multiple worker processes also provides more memory to the application because each worker process has its own memory.
In the context of InProc (in process) caching – one that ASP.NET Cache provides – this has some peculiar issues. Each worker process has its own copy of the Cache. And, while this might allow more Cache storage space, it also creates a cache synchronization problem across worker processes. This can cause some data integrity issues if two caches are out of sync.
Web Farms:
A Web farm can be described as multiple servers hosting a single application and sharing the user request load. When your online users grow, you need to add more servers to process the various user requests that pour in. These servers share the load through a common load balancer than distributes these requests on an even basis among these servers.
In such a situation the need for caching is even more accented. As the number of users increases, so does the load on your application. For example, the number of sessions would go up significantly on each of your web servers. The data that needs to be created by your application is also compounded. The network trips needed to access the database are multiplied and the I/O operations increase rapidly. If you do not handle this load properly, due to all the above mentioned overheads, the performance of your application could be severely hampered. It might respond slowly, prompting your users to lose interest and resulting in loss of revenue for the service provider.
These are just the circumstances around which ASP.NET operates. Once we consider ASP.NET Cache for Web farms, we start to know that its bottlenecks far outweigh the performance overheads discussed above, especially in the case of Web Farms.
A caching solution should have the ability to properly address the above mentioned bottlenecks and configuration drawbacks. It should not only provide a performance enhancement – which ASP.NET does – but also be able to make an application more scalable so it can handle more users and session data. It should also be able to make an application perform reliably and efficiently.
Now, exactly how does ASP.NET Cache fare in light of the various requirements, bottlenecks and restrictions highlighted in this post! Read the next post to find out. If you need immediate information try visiting www.alachisoft.com
Leave a Reply