I have a process P that listens for incoming TCP connections on one port. I am observing that sometimes clients have to issue several SYN to get a SYN-ACK back and then the processing of their connection. I think the process P is not able to handle more than a dozen of incoming parallel connections per second.
Is this delay and retry coming from my process P that is not accepting new TCP connection fast enough ? How could I confirm this ?
The initial handshake is completed by the kernel. The connection is then put in a backlog queue until your process accept() it. You can find more information on the monitoring of this queue size in this related question: https://unix.stackexchange.com/questions/328746/how-can-i-monitor-the-length-of-the-accept-queue