ASP.NET Web Garden - How Many Workflows Do I Need?

What is the best practice for determining how many workflows are allowed for an ASP.NET web application?

On one server, I manage by creating a new default AppPool for 10 (maximum) workflows. Other people assume that the normal setting is one.

What problem does many workflows solve and what are the methods for deciding how many?

+51
web-applications iis-7 worker-process
Jan 27 '10 at 23:47 on
source share
4 answers

Workflows are a way to segment the execution of your website through multiple exe. You do this for several reasons: one, if one of the workers gets clogged due to run-time problems, this does not remove the others. For example, if an html request arrives that causes the process to run to nothing, then only other requests that are processed by this working worker processor will be killed. Another example is that one request may block other threads being processed by the same worker.

As you need, do some stress tests. Hit the application hard and see what happens with only one. Then add a little more and click again. At some point, you will reach a point of truly saturating the network of machines, disk, processor, and bar. This is when you know that you have the right balance.

By the way, you can control the number of threads used for each workflow through the machine.config file. I believe the key is maxWorkerThreads.

Now, be careful if you are using a session, the state of the session is not shared between workflows. I generally recommend avoiding the session anyway, but this should be considered.

For all purposes and tasks, you can consider each workflow, since it belongs to a separate web server. In addition, they work in one window.

+45
Jan 28 '10 at 0:15
source share

The recommendations here are pretty good: http://msdn.microsoft.com/en-us/library/ms998549.aspx

+4
Jan 28
source share

Memory leaks

Another important advantage is the handling of memory leaks. Sometimes you try to optimize your code, but the infrastructure itself and other third-party libraries have memory leaks. We noticed that in the end, our application reaches very high memory and does not give memory exceptions.

Thus, we had to set the maximum virtual memory limit for the workflow as 1GB and allow multiple processes to start. You can set the maximum virtual limit even for one workflow, but this slows down the slowdown, since when the workflow is processed, all requests are slow until the workflow of the work time reaches a good speed. Since our application has internal caching (Entity Framework Query Cache, some object pools), each of these things slows down the application launch. In this case, the main workflow hurts the most.

If there are several work processes, only one of the processes in the processing mode is slow, but others maintain a good speed.

+4
Mar 31 '14 at 6:51
source share

Another thing is when it makes sense to have many workflows if your application contains locks that prevent it from being parallelized. GDI + based image processing is one example.

I found it when I tried to find a solution to my problem .

+1
Jan 02 '17 at 19:53 on
source share



All Articles