We are using LoadRunner to do press test on a tcp-based multi-threaded server application. Recently we encounter an annoying issue:
The clients get error reporting -- "10054 - connection reset by peer" after some cycles. By capturing packets from client, we found clients receive RST from server.
What strange is we don't call any close() or shutdown() from server side (for test purpose), the client still gets the RST packet and 10054 error?!!
Below are the packets I caught:
- 5395 77.335317000 192.168.11.232 192.168.11.30 TCP 62 27124→10000 [SYN] Seq=0 Win=65535 Len=0 MSS=1460 SACK_PERM=1
- 5656 77.356679000 192.168.11.30 192.168.11.232 TCP 60 10000→27124 [SYN, ACK] Seq=0 Ack=1 Win=14600 Len=0 MSS=1460
- 5657 77.356684000 192.168.11.232 192.168.11.30 TCP 54 27124→10000 [ACK] Seq=1 Ack=1 Win=65535 Len=0
- 5776 77.359276000 192.168.11.232 192.168.11.30 TCP 1514 [TCP segment of a reassembled PDU]
- 5778 77.359286000 192.168.11.232 192.168.11.30 HTTP/XML 332 POST /AddressBookController.php HTTP/1.1
- 5901 77.368227000 192.168.11.30 192.168.11.232 TCP 60 10000→27124 [RST] Seq=1 Win=0 Len=0
Here are my questions, any help would be greatly appreciated!
Q1. Why would the server send RST to the client when it doesn't even call any close() or shutdown() to the socket from server side?
Q2. [DUPLICATE Q1, Please Skip]In what condition will a RST be sent by the server when both the client and server haven't called any close() or shutdown?
Q3. Is it possible for me to recompile the kernel and print some log in the TCP stack? I want to know what happened when it sends a RST packet.
[UPDATE]
Increasing the listen(BACKLOG) FROM BackLog=100 to BackLog=1000, will dramatically decreases the errors from around 50/hour to 1~2/10hours. Why?
[UPDATE2]
1. This is a gSOAP server which accepts soap request and returns around
1~2 Kilobytes of data to clients.
2. We checked the packets from client's side, there is no FIN flag from server which proves server never calls any close() or
shutdown().
3. We were using LoadRunner doing press test with 400 USERs make parallel soap requests, the frequency is 80 thousand requests per
hour average.
4. Contents of Packet 4 are nothing abnomal, below are part of it
POST /AddressBookController.php HTTP/1.1
Host: 192.168.11.30:10000
User-Agent: gSOAP/2.7
Content-Type: text/xml; charset=utf-8
Content-Length: 1470
Connection: close
Cookie: sessionId=a23b15dcc14bb1d8f9f6bf3c4ed728d90c4c3939143866821152918211
SOAPAction: ""
<?xml version="1.0" encoding="UTF-8"?>
......