Maximum connection limit in .net frame work 4.7

Antony Maxwin 281 Reputation points
2021-10-11T11:24:45.887+00:00

HI
I have 2 web server, one DB server. and we are running heavy application like Building plan approval system.
in this we need to upload autocad files, and other images, pdf files. and these are stored in SQL 2014 standard edition. we are using iis 7 webserver. and the framework is 4.7 Servers are running with Enough ram and CPU,
What is the maximum concurrent connections that we can have in this frame work..
currently we are getting a maximum of 500 connections without any issue, but when it reach beyond 550 then the application became slow (Considering only one web server).

what are the specification that we need to handle 4000 to 5000 connections.

Thanks

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
697 questions
Internet Information Services
.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,370 questions
SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,707 questions
0 comments No comments
{count} votes

Accepted answer
  1. Bruce Zhang-MSFT 3,736 Reputation points
    2021-10-12T02:54:17.34+00:00

    Hi @Antony Maxwin ,

    In advanced setting of site, IIS allows you set maximum concurrent connections.
    139568-3.jpg

    And in advanced setting of app pool, it allows you set worker processes(w3wp.exe) of app pool.
    139619-4.jpg

    That means each application pool will start one worker process to handle requests by default, and the application which hosts on application pool supports 4294967295 concurrent connections. However, the 4294967295 does not mean that the application can really receive and process so many concurrent requests. It actually represents that http.sys can pass so many concurrent requests to other modules of IIS and asp.net routing. The number of concurrent requests that an Asp.net application can handle is also affected by the asp.net itself.

    If you check the machine.config in C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config and search <processModel>, you will find an item like this:
    139691-5.jpg

    This means that the .net framework will automatically configure the asp.net thread parameters for you to handle concurrent requests according to different situations. The current working thread of .net defaults to “12*CPU” (autoconfig=”true”), so if IIS has two CPUs, there will be 24 working threads.

    The 500 connections you see just the number of IIS and application can create successful connection with client and won't affect the performance of server, not the number of concurrent requests that asp.net can handle at the same time. With more than 500 concurrent requests, the server needs to allocate performance to maintain connections with clients and maintain their queues. This affects the performance assigned to the worker process (w3wp.exe) and slows down application processing.


    If the answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our  documentation  to enable e-mail notifications if you want to receive the related email notification for this thread.

    Best regards,
    Bruce Zhang

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 55,686 Reputation points
    2021-10-11T15:26:11.907+00:00

    the connection limit is probably not the issue. Its settable in IIS but the default is pretty high.

    You need to run performance tests, then determine what resource you are running out of (memory, cpu, threads, i/o, network, GC, sql queries, etc). fix the resource limit, then run again. fix the next resource limit.

    your initial testing shows you start to resource limits at 550 requests. You need to determine what the limit is.

    to get an order of magnitude performance increase, you will probably need to modify your code. as you want to limit the number of threads and improve concurrency, be sure all your code is async. also don't buffer any of the uploads or downloads of large files. again use streaming to read/write to sqlserver.

    0 comments No comments