I built a simple TCP server using Netty and I want to benchmark it with JMeter. I’m using a JMeter TCP Sampler, using the BinaryTCPClientImpl class name to send bytes. I have checked “no delay” and “reuse connection”. I assume these are for SO_NODELAY and SO_REUSEADDR. I’m running 75 threads, each doing 1000 TCP requests. I consistently see about 11% of the requests fail with:
500 java.net.SocketException: Software caused connection abort: socket write error
If I uncheck “reuse connection” then all 75,000 requests succeed without a single error, but the throughput is only ~33% of what it was.
Is there something I need to do with my Netty server to prevent these errors?
I should note my server works like this: accepts connection, receives some data, sends some data, once the data is sent closes the connection. JMeter docs say TCP Sampler closes the connection unless “reuse socket” is checked, so I guess this is not SO_REUSEADDR. I assume in some cases the client sends data, receives data, and before the server closes the socket, the client tries to send data again, then the server closes the socket and JMeter thinks the request failed.
So, the solution is to not check “reuse address”. Closing the socket each request is expected behavior, as my clients communicate relatively infrequently.