Max number of simultaneous connections

Posted on 2006-03-24
Last Modified: 2008-02-20
Hi guys,
What is the maximum number of simultaneous TCP/IP connections in Windows 2003 Server and which factors can reduce that number.

Question by:milan_novkovic
    LVL 95

    Expert Comment

    by:Lee W, MVP
    Given your question history, I'm guessing it's not, but this sounds a lot like a homework question.

    Maximum number is roughly 4 billion.  Factors that can affect it include bandwidth, CPU, RAM, what the connections are doing (Ping responses, serving web pages, ftp, mail, etc).

    Author Comment

    We have a problem with our service which is ISAPI extension written in C++. It seems that when amount of traffic reaches certain point there’s no more connections available to our server, so we have to either physically reboot server or restart IIS with limited number of simultaneous connections.

    Author Comment

    I forgot to tell you that our service is serving POS terminals. Main server is communicating with several other servers (some of them are in LAN, some of them are connected through VPN). When I do netstat -an usually there are around 500 connections (most of them for communication with terminals), but sometimes it reaches over 1000 connections, and by that point we seem to have problems with number of connections.
    LVL 23

    Expert Comment

    Do you actually get an error?

    You say "restart IIS with limited number of simultaneous connections"...are you limiting the # of connections inside IIS?
    LVL 15

    Expert Comment

    Did you install this update?
    There is a fix that is described in KB898060.

    Good luck,


    Author Comment

    My IIS gets locked up after about 700-800 connections.
    Some are in established state (most of them) as I have thousands of clients from the web, while others are in all other states, mostly waiting for possibly delayed packets (TIME_WAIT). When I cut time wait from default 4 minutes to 30 seconds and increase maximum port number from 5000 to what evet the maximum is situation gets better but only for a while.

    My IIS is in unlimited connections state. Why does it lock up? Is there a maximum number of TCP/IP connections per process? (With IIS I have ISAPI extenisons running in dllhosts.

    Connections are from the web but CPU handles all the load with 4% (as it routes requests to other servers), and I have 2 Gig of memory to spare.

    Sudden rush of connections is the most critical (e.g. as I restart the IIS).
    If I instruct the server to limit connections to 50 (to start with) and then keep manulay extending this number server comes up nicely.

    From IIS I go out to 3 other servers using. Two are local (the same machine but different dll hosts) and use http while the third one is remote https.

    After startup the incidence of events (and so creation of new tcp/ip) is from 05. - 1.5 /sec but before of net hickups and OS in general these tend to cluster in groups of 2-5, mostly. but fometimes over 10.

    Can my problem be because extensions under the same IIS (albeit isolated in diffrent dllhosts) are calling each other (there are no circular dependencies)

    I use IIS6 but running in IIs5 mode

    Author Comment

    I am still Win2003 SP1. Had a look at Cisco logs and found no trace of DoS attacs. But would install SP2 and this patch.

    Author Comment

    One sys support guys says that in practice there is a low limit to overall tcp/ip pool on win 2003.
    It was resource related he says. I'll read and understand tomorrow as it's late now.
    I did, however, tried the following 4:

    MaxUserPort = 65534
    MaxHashTableSize = 65536
    MaxFreeTcbs = 16000

    Author Comment

    After reading and trying tools from sysinternals web site I don't now think this is a handle issue (sockets, files, threads individualy or any combination of the three).

    TCP/IP question at the begining was missplaced: IIS can have "unlimited" connections, as they say but it is ultimately limited (my incomplete research) by non-swappable kernel memory as some TCP/IP structures go there. My understanding is that this part of the memory is limited to 128/256 Mb, depending on the OS, but is not only for TCP/IP but for many components of the OS. I have enough resources here at the time I start experiencing problems.

    However, having said "threads" I mean it is not my ISAPI having problems with them.

    But I made serious mistake by executing some lightwaitht commands in IIS I/O thread pool instead in my own worker pool.

    IIS lmits I/O thread pool to 256 threads (I believe this is a hard limit on IIS5, not sure about IIS6).

    I'll fix this but it would stil be good to know why IIS cannot recover from this (if this now proves to be the problem)

    Author Comment

    I learned what was going on and fixed. To help others here it is, 2 things that were wrong:

    - For a good reason at the time I was executing requests in IIS's I/O threads. However, that is quite wrong in bussy systems as there is hard limit of 256 of these threads (not quite sure about the number but close to this figure). After empoying all of these IIS gets suck until some are released. I thought, wrongly, it was the number of TCP/IP connections. Now I release these threads rapidly and shift the work to my worker threads.

    - I was using my ISAPI extension as WinInet client of a few other servers as well. However, WinInet limits the number of concurent connections, over WinInet, to other servers as:
         - 2 to the same http 1.1 server
         - 4 to the same http 1.0 server
       So, plenty of scope to get stuck here so I increased to reasonable numbers, appropriate to my app.

    Thanks for your help and best wishes

    Accepted Solution

    PAQed with points refunded (500)

    Community Support Moderator

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Preface Having the need * to contact many different companies with different infrastructures * do remote maintenance in their network required us to implement a more flexible routing solution. As RAS, PPTP, L2TP and VPN Client connections are no…
    Numerous times I have been asked this questions that what is it that makes my machine log on so slow, there have been cases where computers took 23 minute exactly after taking password and getting to the desktop. Interesting thing was the fact th…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now