java server's ability to accept a huge number of simultaneous connections

Discussion in 'Java' started by shanky001@yahoo.com, Feb 8, 2006.

  1. Guest

    I would appreciate some suggestions or pointers as to where to look
    for, to increase a java server's ability to accept a huge number of
    simultaneous connections.

    Using the backlog feature in java's ServerSocket or NIO hasn't solved
    my problem.

    Details:
    I have java socket server which accepts connections from clients. These
    are persistent connections. I also have a thread pool in the server to
    read/write to the clients
    I did a performance test. I created 100 connections from 8 machines and
    continuously read/write data using the connections.
    I have problems creating lot of connections. even though the client
    retries 50 times before it gives up.
    Out of the attempted 800 client connections 300 seem to fail.

    I am using the backlog feature in java's ServerSocket. It is set to
    400.

    My server is Windows 2000. Is there a setting to increase the number of
    sockets for an application? Am I hitting some OS socket limit?

    I have tried using NIO too. It doesn't seem to work.
     
    , Feb 8, 2006
    #1
    1. Advertising

  2. In article <>,
    wrote:

    > I would appreciate some suggestions or pointers as to where to look
    > for, to increase a java server's ability to accept a huge number of
    > simultaneous connections.
    >
    > Using the backlog feature in java's ServerSocket or NIO hasn't solved
    > my problem.
    >
    > Details:
    > I have java socket server which accepts connections from clients. These
    > are persistent connections. I also have a thread pool in the server to
    > read/write to the clients
    > I did a performance test. I created 100 connections from 8 machines and
    > continuously read/write data using the connections.
    > I have problems creating lot of connections. even though the client
    > retries 50 times before it gives up.
    > Out of the attempted 800 client connections 300 seem to fail.
    >
    > I am using the backlog feature in java's ServerSocket. It is set to
    > 400.
    >
    > My server is Windows 2000. Is there a setting to increase the number of
    > sockets for an application? Am I hitting some OS socket limit?
    >
    > I have tried using NIO too. It doesn't seem to work.


    The backlog indicates the size of the queue of waiting connections. I'd
    think that 400 should be more than large enough for most uses. But the
    real question is probably what you're doing with the connections when
    they arrive. Are you handing them off *immediately* to some other
    thread, thereby allowing the thread with the ServerSocket to check for
    the next one, etc? The longer it takes to hand it off and come back to
    the accept() call, the more connection requests will get dumped.

    = Steve =
    --
    Steve W. Jackson
    Montgomery, Alabama
     
    Steve W. Jackson, Feb 8, 2006
    #2
    1. Advertising

  3. Guest

    Steve,

    Thanks a lot. That suggestion helped. Though the connections were being
    handled by a different thread (eg. SocketHandler), the whole process
    was taking a few milliseconds. I just changed it so that, the
    connection is immediately dumped into a queue and there is a separate
    thread that takes connections of the queue and creates the actual
    socket handling thread (SocketHandler).

    Thanks once again.
     
    , Feb 17, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Eli Sidwell
    Replies:
    7
    Views:
    2,695
    Gavin Williams
    Jun 24, 2004
  2. Ronnie
    Replies:
    1
    Views:
    534
    Roger Oshaug
    Dec 16, 2004
  3. Replies:
    10
    Views:
    1,524
    Roedy Green
    Oct 19, 2005
  4. datbenik

    Simultaneous connections

    datbenik, Jan 20, 2006, in forum: Python
    Replies:
    2
    Views:
    275
    Diez B. Roggisch
    Jan 21, 2006
  5. billiejoex
    Replies:
    4
    Views:
    566
    billiejoex
    Mar 21, 2007
Loading...

Share This Page