extremely long connect times - Networking

This is a discussion on extremely long connect times - Networking ; I have a client application that needs to handle many connections to remote servers. I have a thread handler to deal with the multiple calls to connect() so that the main system can continue working during this (long) system call. ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: extremely long connect times

  1. extremely long connect times

    I have a client application that needs to handle many connections to
    remote servers. I have a thread handler to deal with the multiple
    calls to connect() so that the main system can continue working during
    this (long) system call. During load testing I find that about 8 to
    10 percent of the calls to connect() have not returned after 30
    seconds (at which time I assume they aren't going to complete and I
    close the socket). There are, however, other connections to the same
    host that are initiated and complete in that time frame. When I break
    into the application and look at the backtrace, everything looks
    'normal' (there is still a call to connect in the trace), and looking
    at netstat says that the socket is in the SYN_SENT state.

    Is there any way I can diagnose why so many calls to connect() don't
    seem to complete? Am I being unreasonable that I should expect every
    call to complete? I am testing with a locally connected server to
    remove the possible vagaries of the internet.

    TIA

    Tom


  2. Re: extremely long connect times

    What sort of connection churn rate between any pair of IPs are we
    talking about here?

    If the connection rate between two IPs, a well-known port and a set of
    client ports happens to go faster than:

    sizeof(clientportpsace)/lengthof(TIME_WAIT) you can have a situation
    where a client attempts to establish a new TCP connection while an old
    connection of the same name remains in TIME_WAIT.

    rick jones
    --
    oxymoron n, commuter in a gas-guzzling luxury SUV with an American flag
    these opinions are mine, all mine; HP might not want them anyway...
    feel free to post, OR email to rick.jones2 in hp.com but NOT BOTH...

+ Reply to Thread