CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2011
    Posts
    13

    Server to Client(s) best performance approach question

    I just have a question out of curiosity :

    whats the best approach when dealing with massive clients and a select() call?

    as far as i know if we got about 1000+ connections and call select() to read and select() to write all the time it's gonna consume a looot of CPU right?

    since i cannot test this myself, does any of you know if asynchronous methods kill your cpu the same way?

    whats by your oppinion the best approach on dealing with such things?

  2. #2
    Join Date
    Nov 2002
    Location
    California
    Posts
    4,556

    Re: Server to Client(s) best performance approach question

    Which OS?

    On Windows, the size of the FD_SETs is limited to 64, and hence the maximum number of clients that can be checked in a single call to select() is also 64. (It's possible to change the max size, but hardly worth it because of performance issues.)

    In Windows, therefore, a select-based architecture is a poor choice for a server designed to serve 1000+ connections simultaneously.

    For this, the hands-down winner in Windows is IOCP.

    See this thread for a chart showing a comparison of various architectures (e.g., select, WSAAsyncSelect, WSAEventSelect, overlapped completion routines, IOCP) available under Windows: http://www.codeguru.com/forum/showth...05#post1182005

    Mike

  3. #3
    Join Date
    Sep 2011
    Posts
    13

    Re: Server to Client(s) best performance approach question

    thanks mike
    i'll give it a look

    ---

    but do u have any suggestion for UNIX OSes ?
    Last edited by JacobNax; September 26th, 2011 at 07:13 PM.

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