Kandan Siva
Kandan Siva

Reputation: 479

Jmeter TCP Connection

Below is the configured thread group

enter image description here

Thread Group
 |
 |--> HTTP SAMPLE

I am opening 5 threads in 5 seconds with loop count is 5. It means in each thread 5 HHTP request will be sent, so total 25 request.

Thread 1 : TCP CONNECTION OPENED --> HTTP REQUEST SENT ---> HTTP RESPONSE RECEIVED.

Question: After receiving response whether TCP connection will be closed and again TCP connection will be opened and then HTTP request will be sent?

Or once response is received in same TCP connection next HTTP request will be sent?

Upvotes: 0

Views: 532

Answers (1)

Dmitri T
Dmitri T

Reputation: 168002

It depends on what do you set in the HTTP Request sampler, if you tick Use KeepAlive box - then JMeter will send Connection header with the value of keep-alive

enter image description here

enter image description here

it means that the underlying TCP connection will remain open and the next HTTP Request sampler(s) will be reusing this connection.

If you untick the box JMeter will send Connection header with the value of close and next HTTP Request sampler will re-establish the connection.

You need to check what's going on in reality using your browser developer tools or an external sniffer tool like Wireshark and configure JMeter to behave exactly like the real browser does

Upvotes: 2

Related Questions