Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use Keep Alive option issue

Tags:

jmeter

What is the use of keep alive option in Jmeter and ow its working ?

I did a performance test using Jmeter 3.0 In my recorded script Keep alive option is checked. So i use keep alive option checked in my real test script If i use keep alive option i got error with in 75 concurrent VU's Error message : XXX.XXXX.XXXX:XXX server refused to respond if i un check keep alive option i can able to go up to 500 VU's without error. In this case do we need to use Keep alive option or not ?

like image 433
satkumar Avatar asked Jun 15 '16 08:06

satkumar


2 Answers

Keep-alive is an HTTP feature to keep a persistent connection between round trips, so that it does not initiate a new one on every single request. This feature has many benefits, but one of the trade-offs is that it holds resources on the server side and that can be an issue under heavy load.

In your case, I guess that you've simply consumed all resources on the server with 75 opened connections and that it can't serve further requests. This error does not necessarily mean your server can't serve more than 75 connections, because it all depends on your HTTP server config.

Example of an Apache config:

KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 100

Keep alive on wikipedia

like image 101
basgys Avatar answered Nov 11 '22 11:11

basgys


Ugh! Just ran into this. According to JMeter's documentation:

http://svn.apache.org/repos/asf/jmeter/tags/v5_1_RC2/docs/usermanual/component_reference.html

JMeter sets the Connection: keep-alive header. This does not work properly with the default HTTP implementation, as connection re-use is not under user-control. It does work with the Apache HttpComponents HttpClient implementations.

In other words, JMeter will send the header, but with the default implementation it will not re-use connections.

like image 21
Carlos Rendon Avatar answered Nov 11 '22 12:11

Carlos Rendon