Increase the maximum number of concurrent connections for a web service in IIS7 (load testing)

I am trying to write a simple load tester for one of our web services that feeds through IIS7. I start downloading threads (as tasks) that invoke the web service as a web link.

Despite the fact that all streams are running, only the web service can handle only 2 simultaneous connections from the application.

I know that by specification, concurrent connections are limited to 2 per user . For this load tester, which I believe is one of the users , I would like to open many simultaneous connections.

I tried adding the following to the web.config web service.

<system.net> <connectionManagement> <add address="*" maxconnection="40"/> </connectionManagement> </system.net> 

My setup is as follows:

The web service is located at http: //devserver/MyWebServiceApp/MyWebService.asmx , where MyWebServiceApp is configured as an application.

The web method can be considered as something trivial that just waits, say, 20 seconds before the response returns (which makes it easy to see that only one connection is open at any given time).

The simplest form of load tester code is:

 Imports System.Threading.Tasks Module SuperBasicLoadTester Sub Main() ThreadLauncher(10) End Sub Sub ThreadLauncher(ByVal numberOfThreads As Integer) Dim tasks(numberOfThreads - 1) As Task For index As Integer = 0 To numberOfThreads - 1 tasks(index) = Task.Factory.StartNew(AddressOf SendRequest) Next Task.WaitAll(tasks) End Sub Sub SendRequest() Dim myWebServiceCaller As New MyWebService.ServiceMethods myWebServiceCaller.Url = "http://devserver/MyWebServiceApp/MyWebService.asmx" Dim response As String = myWebServiceCaller.MyWebServiceMethod("Some string passed to the web service method") End Sub End Module 

I tried to specify other load testing software (e.g. soapUI ) in the web service and observed the same problem.

I would appreciate any guidance on how to increase this connection limit (for testing purposes).

Editing:

  • I must add that Windows 2008 R2 is running in the web service window.
  • I also ran SoapUI and my loadtester at the same time, and each of them is only able to request 2 connections each (i.e. a total of 4).

Thanks in advance,

Ali

+7
source share
2 answers

I found the answer here: Multiple simultaneous WCF calls from one client to a service

The problem was with my client, not with the receiving service. I needed to install System.Net.ServicePointManager.DefaultConnectionLimit with client initialization.

+6
source

There is a system limit for TCP connections, which basically means that you will stop TCP using too many resources on your computer.

Check if this helps, but be careful, as this requires some registry tweaking: http://smallvoid.com/article/winnt-tcpip-max-limit.html

+2
source

All Articles