CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 9 of 9
  1. #1
    Join Date
    Sep 1999
    Location
    malaysia
    Posts
    191

    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??

    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

    This project is to test the maximum limits of winsock....for documentation purposes which should have been finished 2 weeks ago...

    Did not include code...cause I dont think that is necessary...??!!

    Thanks in advance

    Mustafa
    Last edited by Mustafa; November 4th, 2004 at 02:37 AM.
    ______________________________
    To err is human, it's the computer that causes blunders !!!

    DO: Dazzle me with your intelligence
    DON'T : Confuse me with your bullshit

  2. #2
    Join Date
    May 2000
    Location
    KY, USA
    Posts
    18,652

    Re: Winsock TCP/IP Connection Limit...pls help

    [ Moved thread ]

  3. #3
    Join Date
    Sep 1999
    Location
    malaysia
    Posts
    191

    Re: Winsock TCP/IP Connection Limit...pls help

    Hi Andreas,

    Why was i moved?? and to where???

    Regards

    Mustafa
    ______________________________
    To err is human, it's the computer that causes blunders !!!

    DO: Dazzle me with your intelligence
    DON'T : Confuse me with your bullshit

  4. #4
    Join Date
    May 2000
    Location
    KY, USA
    Posts
    18,652

    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...

  5. #5
    Join Date
    Sep 1999
    Location
    malaysia
    Posts
    191

    Re: Winsock TCP/IP Connection Limit...pls help

    Dear Andreas,

    I see ....thanks....

    Mustafa
    ______________________________
    To err is human, it's the computer that causes blunders !!!

    DO: Dazzle me with your intelligence
    DON'T : Confuse me with your bullshit

  6. #6
    Join Date
    Sep 1999
    Location
    malaysia
    Posts
    191

    Really need help...anybody pls

    HELP Pls
    ______________________________
    To err is human, it's the computer that causes blunders !!!

    DO: Dazzle me with your intelligence
    DON'T : Confuse me with your bullshit

  7. #7
    Join Date
    Feb 2003
    Location
    Bangalore, India
    Posts
    1,354

    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.
    Even if our suggestions didn't help, please post the answer once you find it. We took the effort to help you, please return it to others.

    * While posting code sections please use CODE tags
    * Please check the codeguru FAQ and do a little search to see if your question have been answered before.
    * Like a post, Rate The Post
    * I blog: Network programming, Bible

    I do all things thru CHRIST who strengthens me

  8. #8
    Join Date
    Sep 1999
    Location
    malaysia
    Posts
    191

    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
    ______________________________
    To err is human, it's the computer that causes blunders !!!

    DO: Dazzle me with your intelligence
    DON'T : Confuse me with your bullshit

  9. #9
    Join Date
    Feb 2003
    Location
    Bangalore, India
    Posts
    1,354

    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.
    Even if our suggestions didn't help, please post the answer once you find it. We took the effort to help you, please return it to others.

    * While posting code sections please use CODE tags
    * Please check the codeguru FAQ and do a little search to see if your question have been answered before.
    * Like a post, Rate The Post
    * I blog: Network programming, Bible

    I do all things thru CHRIST who strengthens me

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured