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
Related
I am learning jmeter to check perform of the web application. This web application is hosted on IIS server and built in php. For testing we use windows 10 PC with 4GB RAM.
I am checking load testing with jmeter where I am sending 10 login request to IIS server with ramp-up periods 3 sec , IIS server stops responding and I have to restart IIS service. If I set ramp-up period 4 SEC then it is working fine.
I m expecting IIS should handle 10 request in 2 sec. For this what configuration should I change in IIS ?
My expectation is that you're hitting IIS concurrent connections limit:
Single JMeter virtual user can open up to 7 connections to the server when retrieving embedded resources so I think you can only do some functional testing using JMeter, but not the load testing.
If you want to identify the limits of your application and conduct some load testing you should consider upgrading to Windows Server operating system which doesn't have this limits.
Alternative solution is migrating from IIS to i.e. Apache which is capable of hosting PHP applications, in this case you will have much more concurrent connections allowed
We have ASP.NET Core application used internally which are used during office hours and a batch that should be processed 3 AM every morning which is scheduled by HangFire like this:
RecurringJob.AddOrUpdate(
() => MyBatch(),
"0 0 3 1/1 *");
The problem is that the Application Pool goes to sleep and the batch isn’t processed if the site isn’t manually started (by going to the website usually).
I have searched SO and tampered with these settings in the Application Pool but with no success:
Some sources that I used to modify the settings:
How to prevent/extend idleTimeout in IIS 7?
https://serverfault.com/questions/443065/how-do-i-prevent-iis-8-from-stopping-idle-asp-net-applications
IIS seems like to sleep until the next request
The Application Pool is used by a total of 7 applications (all being inactive during night when the batch should be processed). The used Application Pool uses .NET CLR Version 2.0.
I'm using IIS version 10.0.17134.1.
How can I make the Application Pool stay active so the batch can be invoked regularly every morning?
I ran into the same issue where my ASP.NET core application goes into idle even with "AlwaysRunning" as start mode for the app pool, "Preload Enabled" set to true for the site, and idle timeout set to 0.
I got it to work by installing the Application Initialization module and setting the .NET CLR version to v4.0. Don't use the "No Managed Code" as that would prevent the Always Running from triggering the app start.
I wrote a blog post on this explaining in more details the steps I took to get the app to run continuously.
They got documentation on how to set up service to run without stopping.
http://docs.hangfire.io/en/latest/deployment-to-production/making-aspnet-app-always-running.html#enabling-service-auto-start
My experience (with older IIS versions 7.5, 8.0) is that it works, but not for app pool recycle/domain unload.
Workaround for me was to send init request on the application_end event.
As above - you need to enable the Service Autostart - in addition to this, if you hit multiple exceptions, I have found that the Rapid Fail Protection has shut down Application pools in the past when using HangFire. So it's also worth disabling (or increasing to reasonable limits) this on the application pool.
I'd suggest you put in your process a single call to the HTTP address first, just like a ping, that would be enought to trigger the site startup if it isn't running for some reason.
One other thing is that, by microsoft's description at MSDN the "AlwaysRunning" option would be:
"Specifies that the Windows Process Activation Service (WAS) will
always start the application pool. This behavior allows an application
to load the operating environment before any serving any HTTP
requests, which reduces the start-up processing for initial HTTP
requests for the application."
That may be, to produce the compilation of web pages that is done on the first call to be done before any request coming, but may not actually run the application at all times.
I am on a Shared IIS Hosting with no access to most settings. What I did is add a Recurring Job that would be triggered in minute interval less than the IIS Timeout/Idle.
RecurringJob.AddOrUpdate<IMyKeepAliveService>("KeepHangFireAlive", svc => svc.KeepHangFireAlive(URL_TO_SELF), "*/4 * * * *");
The above CRON is enough to prevent IIS App pool from going to sleep.
I use RestSharp to make a tiny ping/GET request to "Self".
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.
Recently due to following problem my website stopped working. After restarting tomcat my issue is solved, but I want to know why and when tomcat generates maximum threads.
The problem was as follows:
Maximum number of threads (150) created for connector with address null and port 443
And suddenly my website stopped working.
Few Pointers :
Connectors are defined in server.xml file in $(TOMCAT_HOME)/conf directory. You can check the settings in this file and compare it with default connector setup.
Usually number of threads is equal to the number of incoming requests to the Server. You can check if there is some script which is triggering such requests.
you can also check if the request threads for the webapps are completing their processing normally and getting released for other requests.
if you are using an IDE like eclipse, etc. to start tomcat, then you shall be able to see which threads are being generated when running in debug mode.
Hope this helps.
I have a web application that simply acts as a Front Controller using Spring Boot to call other remote REST services where I am combining Spring's DeferredResult with Observables subscribed on Scheduler.computation().
We are also using JMeter to stress out the web application, and we have noticed that requests start to fail with a 500 status, no response data and no logs anywhere when the number of concurrent threads scheduled in JMeter increases from 25, which obviously is a very "manageable" number for Tomcat.
Digging into the issue with the use of VisualVM to analyze how the threads were being created and used, we realized that the use of rx.Schedulers was somehow impacting the number of threads created by Tomcat NIO. Let me summarize our tests based on the rx.Scheduler used and a test in JMeter with 100 users (threads):
SCHEDULERS.COMPUTATION()
As we're using the Schedulers.computation() and my local machine has 4 available processors, then 4 EventLoop thread pools are created by RxJava (named RxComputationThreadPool-XXX) and ONLY 10 of Tomcat (named http-nio-8080-exec-XXX), as per VisualVM:
http://screencast.com/t/7C9La6K4Kt6
SCHEDULERS.IO() / SCHEDULERS.NEWTHREAD()
This scheduler seems to basically act as the Scheduler.newThread(), so a new thread is always created when required. Again, we can see lots of threads created by RxJava (named RxNewThreadScheduler-XXX), but ONLY 10 for Tomcat (named http-nio-8080-exec-XXX), as per VisualVM:
http://screencast.com/t/K7VWhkxci09o
SCHEDULERS.IMMEDIATE() / NO SCHEDULER
If we disable the creation of new threads in RxJava, either by setting the Schedulers.immediate() or removing it from the Observable, then we see the expected behaviour from Tomcat's threads, i.e. 100 http-nio-8080-exec corresponding to the number of users defined for the JMeter test:
http://screencast.com/t/n9TLVZGJ
Therefore, based on our testing, it's clear to us that the combination of RxJava with Schedulers and Tomcat 8 is somehow constraining the number of threads created by Tomcat... And we have no idea why or how this is happening.
Any help would be much appreciated as this is blocking our development so far.
Thanks in advance.