0
votes

After successfully using JMeter to profile our platform's performance I got the request to simulate a 24h load based on minute-by-minute transaction data extracted from the last year's logs.

At this point, having the static nature of thread creation in jmeter I am wondering if this is easily achievable. I studied the usual plugins together with those at jmeter-plugins.org but still I could not find a straightforward way to do this kind of shaping.

I am looking at the alternative to write a groovy script that dynamically feeds a throughput shaping timer but I am not sure if this is the proper way to go.

Any suggestions?

UPDATE: I tried the follwing combination (as also Alon and Dan suggested): - One thread group with one looping thread and a 60 seconds delay timer; this thread reads every minute from csv the number of requests for the next minute and passes it to the next thread group (using a groovy script and global props) - the second thread group has a fixed number of threads and a Constant Throughput Timer that is updated every minute by the first thread group.

It works partially but the limitation here is that the load/min is divided among all active threads, so part of the threads will still wait to be executed even if the load request changed in the meanwhile. I think that in order to have a correct simulation there should be a way that all threads that were not executed within the minute be interrupted and started again.

So for a concrete example: I have 100 requests in the first minute and 5000 in the second (it is real data with big variations) In the first minute 300 threads have been started (this is my max nr of concurrent connections accepted), but, because they execute very fast they are going to be delayed for more than a minute in order to fulfill the calculated throughput, so the 5000 requests for the next minute don't have a chance to be executed because lots of threads are still sleeping.

So I am looking for a way to interrupt sleeping threads when more throughput is needed. Probably from Groovy or by modifying some JMeter code.

Thanks, Dikran

2

2 Answers

4
votes

You should use JMeter's constant throughput timer for this. In combination with a CSV file that includes all of the values, it should work perfectly. See these links: http://jmeter.apache.org/usermanual/component_reference.html#Constant_Throughput_Timer http://jmeter.apache.org/usermanual/component_reference.html#CSV_Data_Set_Config

Best, Alon.

1
votes

Use JSR 223 + Groovy for Scripting
You have a lot of options to do scripting with JMeter:

  1. Beanshell
  2. BSF and all supported languages Javascript, Scala , Groovy, Java ...
  3. JSR223 and all supported languages Javascript, Scala , Groovy, Java ...

Although you can be lazy and choose the language you know, FORGET ABOUT IT.
Use the most efficient option, which is JSR223 + Groovy + Caching (supported since JMeter 2.8 in external script and in next upcoming JMeter 2.9 also supported with embedded scripts).

Using Groovy is as simple as adding groovy-VERSION-all.jar in <JMETER_HOME>/lib folder.

But of course ensure your script is necessary and efficiently written, DON'T OVERSCRIPT View more over here - http://blazemeter.com/blog/jmeter-performance-and-tuning-tips