The reason for connection reset by peer error was the lower default value for tcp backLog variable.
The maximum number of pending connections.
Its default value seems to be around 50 in Java.
I set this value to numberOfWorkers/2
If numberOfWorkers/2 is less than 50, we use default value.
If numberOfWorkers/2 is more than 2048, we use 2048.
The reason for connection reset by peer error was the lower default value for tcp backLog variable. The maximum number of pending connections. Its default value seems to be around 50 in Java.
I set this value to numberOfWorkers/2 If numberOfWorkers/2 is less than 50, we use default value. If numberOfWorkers/2 is more than 2048, we use 2048.