JMeter TCP 采样器错误地报告 500 [英] JMeter TCP Sampler incorrectly reports 500

查看:30
本文介绍了JMeter TCP 采样器错误地报告 500的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 JMeter 使用 TCP 采样器(BinaryTCPClientImpl 类)对我们的 SMTP 服务器进行负载测试以触发 HELO,等待 30 秒然后退出.

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.

SMTP 服务器接受 HELO 并做出相应的响应,JMeter 记录了正确的响应,但是它似乎没有找到响应,而是达到响应超时并显示请求失败 500.

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.

在 JMeter 日志中它说:

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!

我猜 JMeter 以某种方式未能发现响应的结尾?

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.

推荐答案

如果你没有定义EOM 字节,它读取 直到流结束.由于流不会结束,因此超时.您必须为您使用的协议正确设置 EOM 字节.

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.

这篇关于JMeter TCP 采样器错误地报告 500的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆