IIS ISAPI CGI - How to configure the number of concurrent thrreads? - iis

Good day.
I found many information about how to configure the number of concurrent threads for ASP applications. But what about ISAPI and CGI written without ASP?
I have few CGI applications that need to handle a multiple concurrent requests. And I want to set a number of concurrent threads for that. How can I do it?
Also it will be interesting to get some info about are there some limits on the number of concurrent requests that IIS ISAPI CGI can handle in a default configuration.
Thank you.

Related

IIS 6 Parallel connection limit Web service

Is there any setting in IIS 6 where we can limit number of parallel requests coming from specific host / machine.
I have noticed when a specific web service is invoked from specific server with parallel thread, it times out when parallel thread are more than 10., where as similar works fine when number of parallel thread is limited to 10.
Similar behavior is observed even if requests are coming via Load Balancer to server.
Thanks in anticipation
yes you can, have a look here:
https://learn.microsoft.com/en-us/iis/configuration/system.applicationhost/sites/sitedefaults/limits
The limits element replaces the following IIS 6.0 metabase settings:
ConnectionTimeout
MaxBandwidth
MaxConnections
you may also want to check out this article detailing the steps specifically for IIS6:
https://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/b2b550de-f655-4fb6-9bed-dfc9583b6700.mspx?mfr=true

how many concurrent requests settings for IIS 8.5

How many concurrent requests can be executed in IIS 8.5?
I could not find proper values for how many concurrent requests can be executed in IIS 8.5
As I found out below 2 different values:
By default IIS 8.5 can handle 5000 concurrent requests as per MaxConcurrentRequestsPerCPU settings in aspnet.config
In machine.config, the maxconnection is 2 per CPU as default. So if have 6 core CPU then 12 concurrent requests are possible by default.
So I would like to know that Point 1 is right or Point 2 is right for concurrent requests for IIS 8.5.
Assuming that you are using ASP.NET application, the concurrent requests executed can vary based on the way the application code is written and the framework version you are using to run the application (2.0, 3.5, 4+ etc). Also you are confusing with max connect with concurrent requests. Both are two different things.
For more detailed understanding please read msdn blog ASP.NET Thread Usage on IIS 7.5, IIS 7.0, and IIS 6.0 .
To summarize
MaxConcurrentRequestsPerCPU in
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ASP.NET\2.0.50727.0 determines the number of concurrent requests per CPU. By default, it does not exist and the number of requests per CPU is limited to 12
If your asp.net application is written entirely with asynchronous requests, the default MaxConcurrentReqeustsPerCPU limit of 12 is less and increase this setting MaxConcurrentRequestsPerCPU to a very high number.
In v4.0, the default for MaxConcurrentRequestsPerCPU to 5000
Maxconnection is the setting per HTTP protocol.Any application can only make two concurrent requests to any server.e.g. Your browser(IE 6,7) can make only two connection to your www.example.com. But for speed improvement ,many of the browsers currently make more than 6 simultaneous connections (vary in Chrome, Firefox and IE). Similarly when your server application make a request to a web service or a rest API, the client is your application and maxconnection enforces that for the same server (rest end point), you are allowed to make only two connections .
To increase maxconnection in an ASP.NET application, set
System.Net.ServicePointManager.DefaultConnectionLimit programatically,
from Application_Start, E.g. You can set this to Int32.MaxValue
Hope this helps!
According to this article there is also limitations when running on different Windows versions:
https://blogs.iis.net/owscott/windows-8-iis-8-concurrent-requests-limit
Max concurrent requests
Windows 8:
3 requests
Windows 8 Professional:
10 requests
Windows RT:
N/A since IIS does not run on Windows RT
I assumed (and tested on Windows 10 Home Edition) that on 8 and above this limitations still exists.
These 2 properties are not the same as I think you are implying they are.
MaxConcurrentRequestsPerCPU
Controls the number of incoming requests being handled per CPU
maxconnection
Controls the maximum number of outgoing HTTP connections that you can initiate from a client to a specific IP address.

Is there a limit for how many IIS Application Pools a server can have?

The title sums it up. Is there a limit of how many application pools a server's IIS can have?
The configuration system allows you to set many many more pools, but each pools' worker processes will consume system resources like CPU and memory. Thus, the final limit comes from the worker processes and that's determined by the sites, which vary in all possible ways.

how to clean redundant threads in ColdFusion

Is there a way of telling which threads are redundant and remove them?
Is this something that might need to be done? or do threads self terminate if they encounter any error or are used for too long?
You can get all the active threads and kill them. Go through the link below.
http://coldfusion-tip.blogspot.com/search/label/thread%20kill
You can control the number of available threads in the ColdFusion Administrator under "Server Settings > Request Tuning > Maximum number of simultaneous Template requests" will set the number of available workers/threads ready to accept requests handed off from the webserver. You can fine tune some of the other thread settings (direct CFC/Remoting requests, report requests etc) there as well. The thread pool should recycle itself normally if it encounters a ColdFusion error but there are "hung" threads.
The thread pool should stay at the number set in the administrator. You can set a timeout on a thread's maximum runtime under "Server Settings > Settings > Timeout Requests after seconds" setting.
Using the built-in server monitor under Server Monitoring > Server Monitor You can go to Alerts -> Alert Configuration and set a number of thread killing conditions based on timeouts, memory, etc. but this does increase the load on your system.
This section of the Performance tuning for ColdFusion applications article from Adobe gives you some tips/advice about threads.
Fusion Reactor is a great commercial product for those who need powerful control for high-availability over their ColdFusion server.
Also checkout CFTracker, a free/OSS CF Server Monitoring Project.

IIS advanced logging won't function under load?

Does it make sense that IIS will become extremely slow and unresponsive when using IIS Advanced Logging to log all incoming requests?
I have some rules that divide the incoming requests into 5 files according to their prefix. I found out that a simple stress test of 100 users sending requests nonstop for half an hour. The IIS process memory goes all the way up to 4GB and won't recycle at 500MB limit.
Thanks!
It sounds like there are two separate issues here.
1) IIS does not seem to be respecting the Application Pool Recycling criteria when a process exceeds a specified working set
2) IIS Advanced Logging seems to be consuming large amounts of memory given this configuration.
Regarding #2 - one suggestion is to start by disabling filtering and writing to a single log to see if that alleviates the memory consumption issue. If you don't mind sharing the relevant snippets of the applicationHost.config and/or web.config files that contain your Advanced Logging settings and log definitions, that would be very helpful for repro'ing the issue.
Thanks,
Jack Freelander
IIS Media Services
Was the data written to the files correctly when not under load? Also, was the 500MB limit per log?

Resources