Winsock TCP/IP Connection Limit...pls help
Dear Gurus,
Have been going in and out of this forum looking for hints on the concurrent connection limits of a TCP/IP winsock server. Read most of the posts related to that here...but have not helped...
Hope somebody out there can help...
I have a server software using CAsyncSocket listening for connections on 2 ports say port A and port B.
I have a client software which will try to connect to the server as many times as possible as specified by the user on a specified port.
Placed the server on a LAN, Win2K server...launched 3 copies of the clients on 3 different machines on the LAN with a request to connect 3200 times each...they all connected nicely...no problems...except...each client running on Win2K PRO, cannot go further than 3900 connections...before it runs out of buffer...NOTE:...The SERVER was still fine...it was still standing at 10,000 plus concurrent connections....its the client side which failed...
BUT...when the server was placed in a WAN...running on Win2003....I noticed that I could only connect a maximum of 1976 connections per port??...Eh???..Is that all?? :confused:
Can someone pls explain!!!??...err...been digging the net for this explaination, read some article but...doesnt compute...thus still doesnt help... :(
The closest was something about some registry settings which may reduce the effect of SYNC Flooding..DOS....etc :rolleyes:
This project is to test the maximum limits of winsock....for documentation purposes which should have been finished 2 weeks ago... :mad:
Did not include code...cause I dont think that is necessary...??!!
Thanks in advance
Mustafa
Re: Winsock TCP/IP Connection Limit...pls help
Re: Winsock TCP/IP Connection Limit...pls help
Hi Andreas,
Why was i moved?? and to where???
Regards
Mustafa
Re: Winsock TCP/IP Connection Limit...pls help
I moved it to the network programming forum to increase your chances to get the answers you are seeking for... :cool:
Re: Winsock TCP/IP Connection Limit...pls help
Dear Andreas,
I see ....thanks....
Mustafa
Really need help...anybody pls
Re: Winsock TCP/IP Connection Limit...pls help
A little late...but still I think it might be helpful.
Your question doesn't have a direct answer, because the connection limit depends on many factors. Most important factor is the RAM. For every connection your connected idle socket uses about 2K of Non paged pool memory. If your socket is busy, then it consumes more NP memory. That means the part of physical memory that cannot be paged out to the disk. The NP page is limited in all the OS and the limitations vary. In NT/2000 it is approx. 1/4th the total amount of physical RAM. This is the theory part, but in practice, you may get more that that. Also remember there are many programs that uses NP memory(like drivers), so you won't get all the NP memory. Anyway if you are aiming for handling high connection, it won't be any good if you are using MFC wrapper socket. The best is to use IOCP with overlapped AcceptEx...which needs some studying and searching and research(a bit complex).
Either way, it is bad for you server if the system goes low on resource/NP memory. Some other driver may get into a fix due to low NP memory and could cause the whole OS to crash. So the best way is to test in the server on the site with different simulated load/connection and set a limit. Your server should also monitor the no of overlapped IO.
BTW on tests I got more than 100,000 connections on P4 with 512MB RAM, OS W2K with more that 3000 connections per sec using AcceptEx. But in reality, for such a server depending on other factors I'll restrict the no of connections to < 50,000.
Re: Winsock TCP/IP Connection Limit...pls help
Hi Mathew,
Thanks for responding and thanks for the info but I think I have read that somewhere...but my puzzle is...how come given a bigger/faster machine on the WAN could only connect a much lesser connections than the one on the LAN...which I consider a lesser machine..in terms of memory,CPU etc....
Had been looking at registry settings...and been comparing between the two machines....and it is still is a mystery for me...
Still need help...
Regards
Mustafa
Re: Winsock TCP/IP Connection Limit...pls help
As I said in my previous post it basically depends on the amount of NP memory you are having. Your bigger machine might have more number of programs that utilise more amount of NP memory. Hence you application is left with little. The amount of NP memory is not dependent on any registry settings.
Again as I said previously, if you are looking for higher number/performace, you have to do away with the MFC wrapper class. AcceptEx() with overlapped IO gives the best performance in terms of accepting connections.
Other than the above mentioned, I am not aware of anyother things that may decrease performance.