-1

I'm using TCPSampler in Jmeter to do the performance test on fluentd's TCP input plugin.

But it always runs into 500 error:

Thread Name:Thread Group 1-1
Sample Start:2020-06-23 18:21:08 CST
Load time:2372
Connect Time:360
Latency:0
Size in bytes:0
Sent bytes:0
Headers size in bytes:0
Body size in bytes:0
Sample Count:1
Error Count:1
Data type ("text"|"bin"|""):text
Response code:500
Response message:org.apache.jmeter.protocol.tcp.sampler.ReadException: Error reading from server, bytes read: 0
SampleResult fields:
ContentType: 
DataEncoding: UTF-8

My setting to TCP Sampler is simple:

enter image description here

Because fluentd returns nothing(0-length response) and there is no EOL can be set. Jmeter will hang up until timeout, then reports 500(verified with another simple TCP server with non-0 response).

How should I handle the 0-length response from the TCP server? Appreciate!

========

Seen from the pcap of tcpdump on fluentd side, the package from jmeter has been 'ACK'-ed immediately.

# tcpdump -i ens160 -n tcp port 20001
reading from file from-jmeter.pcap, link-type EN10MB (Ethernet)
06:12:23.716615 IP BEI-L-00040107.olympus.****.com.50411 > telemetry-analytics.pdsea.****.com.microsan: Flags [S], seq 3419810629, win 65535, options [mss 1304,nop,wscale 6,nop,nop,TS val 1134449538 ecr 0,sackOK,eol], length 0
06:12:23.716709 IP telemetry-analytics.pdsea.****.com.microsan > BEI-L-00040107.olympus.****.com.50411: Flags [S.], seq 1061319631, ack 3419810630, win 28960, options [mss 1460,sackOK,TS val 1980947477 ecr 1134449538,nop,wscale 7], length 0
06:12:23.919891 IP BEI-L-00040107.olympus.****.com.50411 > telemetry-analytics.pdsea.****.com.microsan: Flags [.], ack 1, win 2059, options [nop,nop,TS val 1134449760 ecr 1980947477], length 0
06:12:23.920121 IP BEI-L-00040107.olympus.****.com.50411 > telemetry-analytics.pdsea.****.com.microsan: Flags [P.], seq 1:4, ack 1, win 2059, options [nop,nop,TS val 1134449761 ecr 1980947477], length 3
06:12:23.920147 IP telemetry-analytics.pdsea.****.com.microsan > BEI-L-00040107.olympus.****.com.50411: Flags [.], ack 4, win 227, options [nop,nop,TS val 1980947681 ecr 1134449761], length 0
06:12:25.994011 IP BEI-L-00040107.olympus.****.com.50411 > telemetry-analytics.pdsea.****.com.microsan: Flags [F.], seq 4, ack 1, win 2059, options [nop,nop,TS val 1134451735 ecr 1980947681], length 0
06:12:25.994402 IP telemetry-analytics.pdsea.****.com.microsan > BEI-L-00040107.olympus.****.com.50411: Flags [F.], seq 1, ack 5, win 227, options [nop,nop,TS val 1980949755 ecr 1134451735], length 0
06:12:26.220944 IP BEI-L-00040107.olympus.****.com.50411 > telemetry-analytics.pdsea.****.com.microsan: Flags [.], ack 2, win 2059, options [nop,nop,TS val 1134452013 ecr 1980949755], length 0
andrewz
  • 87
  • 1
  • 7
  • You have this back to front. You got 0 length data *because* you got status 500. Not the other way round. You need to examine the server logs to determine why the 500. It is deliberately designed not to leak any information to the client. – user207421 Jun 23 '20 at 11:45
  • @MarquisofLorne Thanks for reminding me of that. However, I verified the server runs OK with no 500 1) from fluentd's log, 2) tcpdump package capturing, 3) data arrival to elasticsearch. I pasted the tcpdump pcap in the post, hope it can helps to my question. Thanks again. – andrewz Jun 23 '20 at 13:58

1 Answers1

0

If you're basically waiting for an empty response and just want JMeter to stop marking the request as failed you can add a Response Assertion as a child of the TCP Sampler and configure it like:

enter image description here

This way JMeter will mark the sampler as passed given status code is 500.

More information: Response Assertions in JMeter 3.2 - New and Improved

Dmitri T
  • 159,985
  • 5
  • 83
  • 133
  • Thanks Dmitri. It's a good way to assert response. However, it seems that it can 'ignore' the 500 errors but cannot eliminate them. – andrewz Jun 24 '20 at 05:06