[Looking for Charlie's main web site?]

Did you know there's a "request execution limit" on IIS? It's 3, 10, 25, or unlimited, depending...

Did you know there's a "request execution limit" on IIS? It's 3, 10, or unlimited, depending on the version of Windows (Vista, 7, 2008) and edition (such as Starter/Home/Basic/Pro/Server).

I'll detail the limits per version/edition below.

I'll also offer a (possibly surprising) workaround that can allow you to get even more requests through IIS, even for a single web site.

(Before I elaborate on that, note that there is a separate issue if you're finding that CF doesn't let you see more than 25 requests at once. That's instead due to a setting in CF/JRun, the maxworkerthreads setting. For more on that, see this blog entry.)

That said, this is a problem which could affect anyone regardless of the app server they may be running behind IIS. (And yes, I do realize that for some, the answer to this problem will be, "see, that's another reason to run Apache." We get that. Let's just focus on this problem for those who choose/have to remain on IIS.)

Background

I was doing some load testing noticed that I couldn't get beyond 3 requests running at a time. I suspected the problem may be IIS.

So at first I tried just making the same requests against CF's built-in web server (such as might be running at port 8500, which can be enabled/configured during CF installation or manually).

Sure enough, CF could execute more requests at once (up to the "simultaneous requests" setting) through the built-in web server.

So that told me the problem had to be in IIS. I did some digging and found the documentation that affirmed what I was seeing.

(Some may recall there used to be a limit of 10 for IIS on Windows XP, so it may surprise some to run into an even lower limit on later Windows versions.)

IIS 7 does have a "request execution limit", for all but Server editions of Windows

The first resource I found was with respect to the limits in Vista. This page says specifically: "With Starter and Home Basic editions of Windows Vista, the simultaneous request execution limit for IIS is three for Windows Vista Home Premium. ...For Windows Vista Business, Enterprise, and Ultimate edition...the simultaneous request execution limit is ten. ..With server editions of Window, IIS 7.0 has no request execution limit."

But I'm sure some reading this will be using Windows 2008. I found a page discussing its limits: for the Basic & Starter editions: 3 requests, for Premium: 3, for Pro: 10, and for Server: unlimited.

I happened to be running Windows 7 when I hit the limit, and while I've not found a document stating the limits specifically for Windows 7, I can again confirm the same limit of 3 on my copy of Windows 7 Home Premium, so I'm sure things are the same, to whatever degree the edition names parallel the other versions. (It's curious that the learn.iis.net page above does discuss both Vista and Windows 2008, but makes no mention of Windows 7.)

A workaround for this limit: multiple worker processes

With respect to this limit, here's a valuable bonus tip that I've not seen documented anywhere: the limit is really per application pool, or more technically per worker process. So you can certainly get more request simultaneously against your box by using multiple app pools.

But perhaps you want to have more requests against a single site, which obviously can be connected only to a single app pool. There's still good news: you can increase the number of worker processes per app pool in the "advanced settings" for a given app pool (right-click on the app pool), increasing "Maximum Worker Processes" from the default of 1. (Some will recognize that as being the same as what was known as "web gardens" for app pools in IIS 6.)

For those new to them, whether creating new app pools or more worker processes for an app pool, for each new worker process, you'll see a new w3wp.exe in task manager.

A caution, for those using ASP.NET, about setting more than one worker process per app pool

Finally, there's a caution to consider if you decide to increase the number of worker processes. At least back in IIS 6, I documented that if you're running an ASP.NET app using sessions that are "inproc" (or in memory), the default, there is a problem with using multiple worker processes (web gardens), in that the sessions are not replicated among the worker processes. That may not be an issue for the OP, so I'll say you can learn more at an entry I did a few years ago.

Did any of this help you? Let me know below.

Vista (and Win 2008) now offers option to delay autostart of services

I just noticed the other day that Vista (and Windows 2008) offers a new option for starting services: Automatic (Delayed Start). This is a pretty important (and for me, long-awaited) feature, whether in development or production. If you've ever felt that too many services were contending with each other as they all tried to start immediately on a restart, this is the solution.

According to various Microsoft resources I've found, such as this, the way it works is that delayed services start after those set to automatic have finished starting. Furthermore:

...it sets the priority of their initial thread to THREAD_PRIORITY_LOWEST. This priority level causes all the disk I/O the thread performs to be Very Low I/O priority. After a service finishes initializing, the Service Control Manager sets its priority to normal. The combination of the delayed start, low CPU and memory priority, and background disk priority greatly reduce interference with a user's logon. Many Windows services, including Background Intelligent Transfer, Windows Update Client, and Windows Media® Center, use the new start type to help improve the performance of logons after a boot.

As you can see, they set various Windows services to use this by default. So, should you use it? And in development or production?

Could be great for development

I can see it being very useful in development, especially. Imagine you want to have certain services running (like CF) but you don't care if they start immediately. Setting them to delayed means your machine can start up faster, and when you do eventually need what the service offers, it should be running.

(Yes, I realize you can start CF manually from the command line instead, and some may prefer that as their means of running CF in development. That's not the point here, though. And I also realize one can even start any window service via shortcuts as well, so as to start them manually. I use that to stop and then start them (rather than open services to restart them if I do it often, as I might with CF during development). I'm still not preferring to run CF from the command line by default, so let's let that debate go. )

I'm just saying that if you do want CF or other services started as services, but you don't really need them running immediately on restart, this seems a good option.

For now, I've enabled it for my two CF services (7 and 8), and their related search and ODBC services, and SQL Server and related services (I've already set MySQL and Oracle to start as "manual" as I use them less frequently), and IIS (world wide publishing service).

Any drawbacks? Time will tell

I say above that it "seems a good option" and "could be great" (and I mention it for development primarily) because I could see a possible problem where the lower disk, cpu, and memory priority could have some unintended consequences if in fact CF requests were to start coming in immediately upon start of CF. Again, perhaps in development this isn't an issue but it's something to keep in mind--and especially for production.

I could just see some admin deeming CF perhaps to be "not as important" as some other services on the machine and so they might set CF for this delayed start. If they don't realize this throttling that happens during service startup in this mode (and its not obvious), I could see it causing problems.

I'll say this bears paying attention to for any who perform troubleshooting on a CF server, if there are any problems during startup. It will now be one of the first things I look into when someone reports problems with CF on startup.

(I won't go so far as to suggest it's had anything to do with the problems some have had with initialization of CF due to JVM 1.6. Since it seems those were indeed solved by going back to 1.5, it doesn't appear it could have been due to this instead.)

There are some other interesting new features in Vista and 2k8 regarding services, especially "Preshutdown Notification". I may write more about those in a future entry.

And if anyone would want to snipe that their OS has long had features like the above, please, save it. :-) I'm here to help those who want or have to choose to use Windows. This isn't the place to try to evangelize them away or to carp about how they are or have been missing out. Thanks.

BlogCFC was created by Raymond Camden. This blog is running version 5.005.

Managed Hosting Services provided by
Managed Dedicated Hosting