Max number of simultaneous connections

Hi guys,
What is the maximum number of simultaneous TCP/IP connections in Windows 2003 Server and which factors can reduce that number.

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Lee W, MVPTechnology and Business Process AdvisorCommented:
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).
milan_novkovicAuthor Commented:
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.
milan_novkovicAuthor Commented:
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.
Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

Do you actually get an error?

You say "restart IIS with limited number of simultaneous connections"...are you limiting the # of connections inside IIS?
Did you install this update?
There is a fix that is described in KB898060.

Good luck,

milan_novkovicAuthor Commented:
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
milan_novkovicAuthor Commented:
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.
milan_novkovicAuthor Commented:
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
milan_novkovicAuthor Commented:
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)
milan_novkovicAuthor Commented:
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
PAQed with points refunded (500)

Community Support Moderator

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Server 2003

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.