Get Knowledge from Video instead of Content:

Monday, 30 January 2017

JMeter - PreProcessor - "Sample Timeout"

Let's consider, you are running a load test and hitting the server with the max of its capacity. The server responding the to the request with its strength but most of the request are piled-up and the server takes a long time to respond. What will happen at the JMeter end in this situation? 

Definitely, JMeter waits to fire the next request until the response of the previous request comes. This will impact the test TPS/RPS and you can not achieve the desired throughput. 

To overcome this situation, "Sample Timeout" preprocessor is added under those samples where threads may get stuck. Sample Timeout sets a maximum timeout for a particular sampler and executes when the response time exceeds the given timeout value and instruct JMeter to fire the next request. 
One point to be noted here, the timeout should be set sufficiently long so that it is not triggered in normal tests, but short enough that it interrupts samples that are stuck. Also, it is recommended not to use sample timeout for all the samplers. You can use this preprocessor for those pages where DB queries are executed, long calculative logics are written in the code etc.

Sample Timeout preprocessor can be used with AJP, BeanShell, FTP, HTTP, Soap, AccessLog, MailReader, JMS Subscriber, TCPSampler, TestAction, JavaSampler.

How to add "Sample Timeout" preprocessor element?
You can follow the below steps:
1. Select "Sampler" node where you want to add the preprocessor
2. Right-click on the node
3. Mouse hovers "Add"
4. Mouse hovers "Pre Processors"
5. Click "Sample Timeout"

How to remove "Sample Timeout" preprocessor element?
You can follow the below steps:
1. Select "Sample Timeout" node
2. Right click on "Sample Timeout" node
3. Click "Remove" (Mouse) or "Delete" button from the keyboard
4. Click "Yes"    

What are the attributes of "Sample Timeout" element?

"Sample Timeout" has following attributes:
  • Name: To provide the name of the preprocessor
  • Comments: To provide arbitrary comments (if any)
  • Sample Timeout (in milliseconds): To input the timeout value in milliseconds. 
Previous Topic:
Apache JMeter - "JSR223 PreProcessor" Element

Related Topics:

No comments :

Post a Comment