简体   繁体   中英

JMeter understanding ramp-up

This is the configuration of my test plan thread properties:

Number of Threads (users): 100
Ramp-up Period (in seconds): 10
Loop Count : Forever
Delay thread creation until needed: No
Scheduler: No

I ran the test overnight with the total duration of 14 hours and 7 minutes (approximately 50820 seconds). After loading the jtl file, The number of samples shown in summary report is 1050975. I tried to compute but I can't understand how it came up with that many sample.

If Ramp-up Period is the time taken by JMeter to create the number of threads per iteration and if the duration of the test is 50820 seconds, then I should have 508200 samples only ( 50820/10 * 100 ). I do not know how or if Loop Count affects this.

The ramp-up in the Thread Group is the time JMeter should take to start the total number of threads. In your situation this means that every 0.1 second a new thread starts giving 100 running threads after 10 seconds. These 100 threads perform your test iterations back-to-back, so after the ramp-up 100 threads run continously for the duration of the test.

Ramp-up Period - The time frame (in seconds) for all requests to start. All the threads specified in the Number of Threads input will start within Ramp-up period .

For instance:

100 threads and 100 seconds ramp-up: each second JMeter will start 1 Thread until all threads are started by the time the 100 seconds are up.

100 threads and 50 seconds ramp-up: each second 2 Threads are started.

100 threads and 200 seconds ramp-up: every 2 seconds , 1 Thread is started.

Now,

The sample or request generation is a different concept than Thread generation .In you case, 100 threads were up within 10 seconds.The key factor here is the Throughput . As per JMeter glossary:

Throughput is calculated as requests/unit of time. The time is calculated from the start of the first sample to the end of the last sample. This includes any intervals between samples, as it is supposed to represent the load on the server.

The formula is: Throughput = (number of requests) / (total time).

Here the Number of Executed Samples or Requests are 1050975 and the Test duration is 50820 seconds. So this is related to Throughput.The output 1050975 requests in 50820s mean the Average Throughput throughout your test was approximate 20.5/s .

To take control over Throughput or Transactions per second there are very handy JMeter plugins called Constant Throughput Timer .

Constant Throughput Timer introduces variable pauses, calculated to keep the total throughput (in terms of samples per minute) as close as possible to a given figure. Of course, the throughput will be lower if the server is not capable of handling it, or if other timers or time-consuming test elements prevent it.

The ramp-up period tells JMeter how long to take to “ramp-up” to the full number of threads.

@Little Chicken Understanding 1 is correct.

If 10 threads are used, and the ramp-up period is 10 seconds, then JMeter will take 10 seconds to get all 10 threads up and running.

Each thread will start 1 second after the previous thread was begun.

The ramp-up period tells JMeter how long to take to "ramp-up" to the full number of threads chosen. If 10 threads are used, and the ramp-up period is 100 seconds, then JMeter will take 100 seconds to get all 10 threads up and running. Each thread will start 10 (100/10) seconds after the previous thread was begun. If there are 30 threads and a ramp-up period of 120 seconds, then each successive thread will be delayed by 4 seconds.

Understanding 1: is correct The ramp-up period tells JMeter how long to take to "ramp-up" to the full number of threads chosen. If 10 threads are used, and the ramp-up period is 100 seconds, then JMeter will take 100 seconds to get all 10 threads up and running. Each thread will start 10 (100/10) seconds after the previous thread was begun. If there are 30 threads and a ramp-up period of 120 seconds, then each successive thread will be delayed by 4 seconds

Ramp up Period: Rate at which the users will be onborded to start the trasaction.

In jMeter, with 10 users if you give a ramp up time of 20, then 1 user will start executing the plan every 2 seconds.

This property tells JMeter how long to delay between starting each user.

For example, if you enter a Ramp-Up Period of 5 seconds, JMeter will finish starting all of your users by the end of the 5 seconds. So, if we have 5 users and a 5 second Ramp-Up Period, then the delay between starting users would be 1 second (5 users / 5 seconds = 1 user per second). If you set the value to 0, then JMeter will immediately start all of your users.

For Example

  1. 1000 target threads with 1000 seconds ramp-up: JMeter will add one user each second
  2. 1000 target threads with 100 seconds ramp-up: JMeter will add 10 users each second
  3. 1000 target threads with 50 seconds ramp-up: JMeter will add 20 users each second

When you have , say a 100 threads , you can give a ramp up of 10 seconds. But if your total threads are only 5 or 10, you have to give 0 ramp up seconds. Because it is then common for your application to get 5 hits at the exact second. So keep this in mind. If you think it is possible to get 10 hits at the same second, then give ramp up as 0 for the thread group and give an infinite loop and define the duration

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM