Role of Web gardens and web farms in ASP.NETDistributed applications that implement complex business processes face the challenge of providing high level of scalability and availability as the number of its users in the web become larger.
There are many cases, especially in a production kind of environment where there are millions of user hits that needs to be serviced by the web site. It is found better to address this issue at the stage of designing a distributed application rather than the stage of deployment. Web farms and web gardens are options that need to be considered while designing for scalability and availability features of such applications. Web Farm Web farm is a group of web servers having same software configuration and content but acting as a single virtual server with one TCP/IP address to clients. They service the clients by optimally sharing the internal resources and distribute the load equally amongst themselves. Web farm is built on the principle of Load Balancing. Load balancing is a process in which the network packets are routed through a special switch to different web servers based on the options configured in it. The main function of the Load Balancer is to balance client requests between servers and optimize the wait time at the client side while utilizing the maximum use of server resources. The possible routing logic can be of the following types: Round
robin: Each server node gets its turn cyclically so the request is processed
equally within the servers Web farms are typically used in server farms in enterprises which have backup servers that service requests in case of failure of the primary servers. These backup servers can be configured with replication systems so that duplicate data is always available. Also, Internet Service Providers(ISP) use this technology for providing web hosting services using multiple servers to provide better availability and performance. To handle peak load in normal server applications which are less mission-critical, a single domain with multiple servers and a database is used. Advantages of Web Farm Better
scalability by handling large capacity Web Garden Web garden is a single web server executing server processes across multiple CPUs. Without Web garden, there will be only one ASP.net worker process (w3wp.exe) executing in the CPU. This process executes all the requests that come to the server. With web garden, different instances of the worker process are created and executed in different CPUs. Hence, Web gardens provide better performance by avoiding the delay caused due to waiting for a worker process which is busy in processing a request. Typically, web garden is better used in the following scenarios: when
there is need to share resources and hence can cause contention of resources
Advantages of Web Garden Increases
application availability Implementation of Web farm and Web garden in .Net To implement web farm in .Net, following changes have to be made in web.config file: Mode = [inproc/StateServer/SqlServer] Option, inproc to be used when there is no web farm , StateServer when performance is required while SqlServer, if reliability is needed, especially for mission critical applications. To implement web garden in .Net, following changes have to be made in web.config file: webGarden=[true]
Best practices ASP.net offers a facility to store the session info either in SQLServer database or in a separate State Service maintained in a separate machine and accessed by all servers Minimize the access to data store as much since the overhead caused here can bring down the performance enhancement seen due to effect of Load balancing
<machinekey=> These are the sections that represent the cryptographic keys and authentication tickets for checking ViewState and User credentials of request to decode the sessionState of the client correctly. Hence, they need to be same so that any server can service any request from the client. This need not be done for a Web garden since all the worker processes are executed in the same server. While using Web Gardens, use Out-of-proc option for session state management. Do not use In-proc. It is a good design practice to architect a system that is scalable from a single server to a web farm or web garden based scenario so as to leverage this clustering technology provided by .Net. It is a tough task to implement and is based on the budget allocated for developing the system as it involves both hardware and software.
|