Connection reset by peer problem summary and solution, connectionpeer
I searched for Chinese and English websites, searched the corners I could find, found the cause and principle of the fault, and how to solve the problem. Here I will record it and hope to help some friends who need it, if you do not need to take a detour, you can sort out the content as follows:
Connection reset by peer problem summary and Solution
1. When the number of concurrent connections on the server exceeds its capacity, the server closes some of the connections.
If you know that the number of concurrent clients connecting to the server does not exceed the server load, it may be a virus or Trojan, causing network traffic exceptions.
Solution: run the netstat-an command to view network connections.
2. The client closes the browser, and the server is still sending data to the client.
3. the browser presses Stop
These two cases generally do not affect the server. However, if the exception information is not specially processed, the exception may be repeated in the server log file, resulting in the server log file being too large, the operation of the server is affected.
Solution: try... Catch exceptions, and then do not output or output only one prompt to avoid all exceptions.
4. Firewall Problems
If the network connection passes through the firewall, and the firewall usually has a timeout mechanism, when the network connection does not transmit data for a long time, the TCP session will be closed and then read and write, this will cause exceptions.
Solution: If the firewall is disabled and the problem is solved, you need to reconfigure the firewall or write your own program to implement TCP persistent connections.
To achieve TCP persistent connections, you need to define the heartbeat protocol and send the heartbeat protocol at intervals. Both parties maintain the connection.
5. JSP buffer Problems
The default JSP page cache is 8 KB. When the JSP page data is large, it is possible that JSP is not completely transmitted to the browser.
Solution: Adjust the buffer size.
<% @ Page buffer = "100 k" %>
Thank you for reading this article. I hope it will help you. Thank you for your support for this site!