5

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.

3
  • How was it supposed to find the end of the response? Commented May 21, 2012 at 10:57
  • I guessed by the setting tcp.eolByte in jmeter.properties which I have done (to 10). Commented May 21, 2012 at 10:58
  • replied to below in response to your answer. Commented May 21, 2012 at 11:23

1 Answer 1

7

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.

3
  • SMTP protocol so the last 2 bytes should /r/n (0d0a / 1310). I have eolbyte set to 10, but it still doesn't work. Commented May 21, 2012 at 11:18
  • 1
    Aah I see what you mean, thought you typoed EOM byte and meant tcp.eolByte! Setting tcp.BinaryTCPClient.eomByte to 10 makes everything work. Cheers! Commented May 21, 2012 at 11:36
  • how can i send a few request per one channel connection using tcp sampler ? should i rewrite TCP Sampler?
    – Mikhail
    Commented Mar 16, 2015 at 20:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.