Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JMeter TCP Sampler incorrectly reports 500

Tags:

tcp

smtp

jmeter

I'm using JMeter to load test our SMTP server using the TCP Sampler (BinaryTCPClientImpl class) to fire HELOs, wait for 30 seconds and then QUITing.

The SMTP server accepts the HELO and responds accordingly, with JMeter logging the correct response, however it does not appear to find then of the response and instead hits the response timeout and shows a 500 fail for the request.

In the JMeter logs it says:

ERROR - jmeter.protocol.tcp.sampler.TCPSampler:      org.apache.jmeter.protocol.tcp.sampler.ReadException:
at org.apache.jmeter.protocol.tcp.sampler.BinaryTCPClientImpl.read(BinaryTCPClientImpl.java:137)
at org.apache.jmeter.protocol.tcp.sampler.TCPSampler.sample(TCPSampler.java:350)
at org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:416)
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:271)
at java.lang.Thread.run(Unknown Source)
Caused by: java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(Unknown Source)
at java.net.SocketInputStream.read(Unknown Source)
at java.net.SocketInputStream.read(Unknown Source)
at org.apache.jmeter.protocol.tcp.sampler.BinaryTCPClientImpl.read(BinaryTCPClientImpl.java:123)

This despite the fact it managed to log the expected response!

I'm guessing JMeter has somehow failed to spot the end of the response?

Any thoughts in how to solve or debug this would be much appreciated.

like image 332
Alex Webber Avatar asked May 21 '12 10:05

Alex Webber


1 Answers

If you don't define the EOM byte, it reads until the end of the stream. Since the stream isn't going to end, it times out. You have to set the EOM byte correctly for the protocol you're using.

like image 118
David Schwartz Avatar answered Oct 18 '22 00:10

David Schwartz