Wednesday, December 7, 2011

Do i need Web Garden for more reliablity

Q. How Many Worker Processes Do I Need?
 Q. Do i need Web Garden for more reliablity?
 A.

Worker processes are a way of segmenting the execution of your website across multiple exe's. You do this for a couple of reasons, one if one of the workers gets clobbered by run time issues it doesn't take the others down. For example, if a html request comes in that causes the process to run off into nothing then only the other requests that are being handled by that one worker processor get killed. Another example is that one request could cause blocking against the other threads handled by the same worker.

As far as how many you need, do some load testing. Hit the app hard and see what happens with only one. Then add some more to it and hit it again. At some point you'll reach a point of truly saturating the machines network, disk, cpu, and ram. That's when you know you have the right balance.

Incidentally, you can control the number of threads used per worker process via the machine.config file. I believe the key is maxWorkerThreads.

Now, beware, if you use session, Session state is not shared between worker processes. I generally recommend avoiding session anyway but it is something to consider.


For all intents and purposes you might consider each worker process as it's own separate web server. Except they are running on the same box.

 Creating a Web garden for an application pool can also enhance performance in the following situations:
• Robust processing of requests: When a worker process in an application pool is tied up (for example, when a script engine stops responding), other worker processes can accept and process requests for the application pool.
• Reduced contention for resources: When a Web garden reaches a steady state, each new TCP/IP connection is assigned, according to a round-robin scheme, to a worker process in the Web garden. This helps smooth out workloads and reduce contention for resources that are bound to a worker process.

 For even greater reliability, you can configure an application pool to be supported by multiple worker processes. An application pool that uses more than one worker process is called a Web garden. The worker processes in a Web garden share the requests that arrive for that particular application pool. If a worker process fails, another worker process can continue to process requests. 

A process serving application pool suffered a fatal communication error with the Windows Process Activation Service.

Why does Application Pool Crashes Sometimes?
I was getting this error on my server

Log Name:      Application
Source:        Application Error
Date:          12/6/2011 3:57:47 PM
Event ID:      1000
Task Category: (100)
Level:         Error
Keywords:      Classic
User:          N/A
Computer:      XXX
Description:
Faulting application name: w3wp.exe, version: 7.5.7601.17514, time stamp: 0x4ce7a5f8
Faulting module name: KERNELBASE.dll, version: 6.1.7601.17651, time stamp: 0x4e211319
Exception code: 0xe053534f
Fault offset: 0x0000b9bc
Faulting process id: 0x%9
Faulting application start time: 0x%10
Faulting application path: %11
Faulting module path: %12
Report Id: %13
Event Xml:

 
   
    1000
    2
    100
    0x80000000000000
   
    73326
    Application
    XXX
   
 
 
    w3wp.exe
    7.5.7601.17514
    4ce7a5f8
    KERNELBASE.dll
    6.1.7601.17651
    4e211319
    e053534f
    0000b9bc
 

and after this i usually get an error


"A process serving application pool 'XXX' suffered a fatal communication error with the Windows Process Activation Service. The process id was '1234'. The data field contains the error number."





I am running an ASP.NET Framework 3.5 under integrated environment web application on IIS 7.5 on Windows Server 2008 R2.Sometimes i get this error  When access to the website, it raise error message: ‘HTTP Error 503. The service is unavailable.’.

I am still working on this issue and got some temporary measures that delay this error
measures taken under Application pool advanced settings changed the settings :
1)   Maximum worker processes to 2 and made it a Web Garden
2)  Changed the Rapid failed protection Failure interval to 2
3)  And lastly changed the Recycling regular time interval from 1740 (default) to 1000.

since that time its working properly but for a quick measure when you are facing this issue
 go to the Internet Information Services (IIS) Manager to recycle my Application Pool again. it would work properly .

What is webgarden and Application Pool?


Question -> What is webgarden and Application Pool?
Answer.
Webgarden ->A Web garden is configured on a single server by specifying multiple worker processes for an application pool.

Application Pool ->An Application Pool can contain one or more applications and allows us to configure a level of isolation between different Web applications. For example, if you want to isolate all the Web applications running in the same computer, you can do this by creating a separate application pool for every Web application and placing them in their corresponding application pool. Because each application pool runs in its own worker process, errors in one application pool will not affect the applications running in other application pools. Deploying applications in application pools is a primary advantage of running IIS 6.0 in worker process isolation mode because you can customize the application pools to achieve the degree of application isolation that you need.


Question ->Where to set webgarden in IIS?
Answer :
1) Configuring Web Gardens with IIS 6.0
This feature of IIS 6.0 is available only when IIS is running in worker process isolation mode.
To configure a Web garden by using IIS Manager
A.
In IIS Manager, expand the local computer, expand Application Pools, right-click the application pool, and then click Properties.
B.
Click the Performance tab, and under Web garden, in the Maximum number of worker processes box, type the number of worker processes that you want to assign to the application pool. (You must type a number greater than 1 for the application pool to become a Web garden.
C.
Click OK.





2) Configuring Web Gardens with IIS 7.0 and IIS 7.5(windows server 2008   )

This feature of IIS 6.0 is available only when IIS is running in worker process isolation mode.

To configure a Web garden by using IIS Manager
A.
In IIS Manager, expand the local computer, expand Application Pools, right-click the application pool, and then click Advanced Settings.
B.
Under Process Model,in the Maximum number of worker processes box, type the number of worker processes that you want to assign to the application pool. (You must type a number greater than 1 for the application pool to become a Web garden.
C.
Click OK.


To configure a Web garden by using Adsutil.vbs
A.
In the Run dialog box, type cmd, and then click OK.
B.
At the command prompt, type:
cscript %SystemDrive%\Inetpub\AdminScripts\adsutil.vbs set W3SVC/AppPools/ApplicationPoolName/MaxProcesses n
Replace n with the number of worker processes that you want to service the application pool.