0
votes

I've started using JMeter for performance load testing different scenarios with my microservices. I have been able to use the Constant Throughput Timer to send requests and measure the throughput and RPS. However, with Constant Throughput Timer, JMeter will adjust the number of requests depending on how fast the web service is responding to these services.

Is there a way to achieve a constant RPS through the duration of the test? Basically sending 40 requests per second at a constant rate for 10 mins. I'm aware that this may increase the error rate but this would help us in testing how well our microservices perform under different scenarios

My current jmx plan is as follows

<hashTree>
      <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="something" enabled="true">
        <stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
        <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">
          <boolProp name="LoopController.continue_forever">false</boolProp>
          <intProp name="LoopController.loops">-1</intProp>
        </elementProp>
        <stringProp name="ThreadGroup.num_threads">${threadnum}</stringProp>
        <stringProp name="ThreadGroup.ramp_time">1</stringProp>
        <longProp name="ThreadGroup.start_time">1381113647000</longProp>
        <longProp name="ThreadGroup.end_time">1381113647000</longProp>
        <boolProp name="ThreadGroup.scheduler">true</boolProp>
        <stringProp name="ThreadGroup.duration">${duration}</stringProp>
        <stringProp name="ThreadGroup.delay">0</stringProp>
        <boolProp name="ThreadGroup.same_user_on_next_iteration">true</boolProp>
      </ThreadGroup>
      <hashTree>
        <ConstantThroughputTimer guiclass="TestBeanGUI" testclass="ConstantThroughputTimer" testname="Constant Throughput Timer" enabled="true">
          <intProp name="calcMode">2</intProp>
          <stringProp name="throughput">${throughput}</stringProp>
        </ConstantThroughputTimer>
        <hashTree/>
1

1 Answers

0
votes

JMeter threads model assumes waiting for the response prior to sending the next request, if your application won't be able to handle more than 30 requests per second there is no way to get 40 requests per second using HTTP Request samplers

Also Constant Throughput Timer is only capable of slowing down JMeter to limit its requests rate to the desired throughput so make sure to supply sufficient number of threads via this ${threadnum} variable. Otherwise you might consider switching to Throughput Shaping Timer and Concurrency Thread Group combination, if you connect them via Feedback Function JMeter will have the possibility to kick off more threads if the current amount is not enough in order to reach/maintain the target throughput