JMeter настройка Thread Group, параметры Rump-Up period и Loop Count?
#1 AntonK
Всем привет.
Осваиваю JMeter, и в процессе курения мануала и запуска пробных тестов возникло недопонимание одного момента.
У нас есть параметры:
Number of Threads — это количество юзеров которые будут заходить на сайт
Rump-Up period — это за который все наши юзеры зайдут на сайт
Loop Count — это кол-во циклов исполнения юзерами действий в Thread Group
Для тестирования были взяты данные из потолка
Number of Threads = 10
Rump-Up period =15 sec
Loop Count = 100
Далее то что я не до конца понял:
У нас «зайдут» на сайт 10 юзеров в течении 15 секунд и это все повторится 100 раз и в итоге у нас отправится 1000 запросов, и следовательно время прохождения скрипта должно занять 1500 секунд (15 секунд*100 раз), но проходит +-150 секунд. Т.е они идут как-то параллельно?
Как отправляются запросы? Заходят 10 юзеров в течении 15 сек, затем опять 10 юзеров в течении 15 сек, и тд. 100 раз? Или согласно заданным параметрам 10 юзеров должны войти на сайт 100 раз в течении 15 секунд, но так как 1000 запросов не успевает отправится в течении заданного времени это продолжается дольше?
Прикрепленные файлы
Clip2net_160118175133.png289,15К 2 Количество загрузок:
#2 BadMF
- ФИО: Dmitry Petrov
Они идут последовательно один за другим без промежутков.
Т.е. у вас есть 15 сек до начала выполнения запросов к серверу, за эти 15 сек все пользователи подключаются (если проводить аналогию с реальной жизнью, открывают браузер, вводят адрес сервера в адресную строку и ждут команды стартовать), как только 15 сек прошло, пользователи начинают бешено жать на кнопку рефреш, сразу как получают ответ от сервера от предыдущего рефреша.
Для того чтобы у вас были промежутки между запросами у каждого конкретного пользователя, необходимо отдельно настраивать таймаут внутри Thread.
#3 AntonK
Вы имеете в виду что в промежуток от запуска до истечения 15 секунд никаких запросов отправляться не будет? Но на практике у меня сразу отправляются запросы. (см. вложение)
И в мануале JMeter написано:
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.
Для того чтобы у вас были промежутки между запросами у каждого конкретного пользователя, необходимо отдельно настраивать таймаут внутри Thread.
Промежутки мне пока не нужны, я хочу понять взаимосвязь между этими тремя параметрами
Прикрепленные файлы
1.png292,95К 2 Количество загрузок:
#4 Little_CJIOH
- ФИО: Власкин Павел
- Город: Санкт-Петербург
Number of Threads = 10
Количество потоков выполняющих тестовые сценарии одновременно
Rump-Up period =15 sec
Время разогрева, к концу этого времени должны быть запущены все упомянутые выше потоки, то есть каждый следующий поток будет стартовать через полторы секунды. Параметр нужен чтоб ничего нигде не порвать при старте нагрузки
Loop Count = 100
Сколько раз выполнит сценарий каждый из потоков.
То есть, запустив с такими параметрами вы получите исполнение своего сценария 1000 раз, в 10 одновременно работающих «пользователей», первые 15 секунд теста нагрузка у вас будет нарастать.
#5 AntonK
Т.е.10 потоков стартуют по очереди через 1,5 секунды каждый и повторяются они по 100 раз.
Т.е. 1-й поток начинает, к нему подключается 2й через 1,5 секунды и тд. (соотв. нагрузка растет)
И в конце работы, 1-й поток закончит свою работу раньше по сравнению с 10-м, т.к. 100 итераций он совершил раньше. (и нагрузка к концу будет немного снижаться)
Все верно понял?
#6 BadMF
- ФИО: Dmitry Petrov
Да всё правильно поняли.
Да, и извиняюсь за дезинформацию, сам не часто работал с джметером. но я был близок =)
#7 Little_CJIOH
- ФИО: Власкин Павел
- Город: Санкт-Петербург
Т.е.10 потоков стартуют по очереди через 1,5 секунды каждый и повторяются они по 100 раз.
Т.е. 1-й поток начинает, к нему подключается 2й через 1,5 секунды и тд. (соотв. нагрузка растет)
И в конце работы, 1-й поток закончит свою работу раньше по сравнению с 10-м, т.к. 100 итераций он совершил раньше. (и нагрузка к концу будет немного снижаться)
Все верно понял?
Почти. Порядок окончания нагрузки будет таким как вы описали на сферической системе в вакууме. Практически же последовательность и время окончания каждого потока зависит от скорости реакции системы на каждый запрос, так что предсказать что-либо крайне сложно.
#8 AntonK
Источник
What is the ramp-up period in jmeter?
I ran a test plan with 5 users for a total of 20 seconds and what I am not able to understand is what ramp-up period is in actual. Does it means that each user will get 4 seconds or 20 seconds will be used in total for 5 users?
If case 1 is true(4 second for each user) then the first thread should be completed in 4 seconds but it took 6 seconds to complete it and still the result is passed and next user gets executed? This gets much confusing. I need to clear my doubt as I am not able to find any answers from all the inputs that are available here
2 Answers 2
How long JMeter should take to get all the threads started. If there are 10 threads and a ramp-up time of 100 seconds, then each thread will begin 10 seconds after the previous thread started, for a total time of 100 seconds to get the test fully up to speed.
You have 5 users
- if you set ramp-up period to 0 — all 5 users will start at once
- if you set ramp-up period to 5 — JMeter will start with 1 user and will add an extra 1 user each second
- if you set ramp-up period to 10 — JMeter will start with 1 user and will add an extra 1 user each 2 seconds
- etc.
Once user is started it starts executing Samplers upside down (or according to Logic Controllers) when there are no more samplers to execute or loops to iterate — the thread is being shut down.
Check out JMeter Ramp-Up — The Ultimate Guide article for more information on configuring users arrival rate.
You might also be interested in Ultimate Thread Group which makes workload definition easier, moreover you will have a chart representing anticipated load. You can install Ultimate Thread Group using JMeter Plugins Manager
Источник
JMeter understanding ramp-up
This is the configuration of my test plan thread properties:
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.
8 Answers 8
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 .
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.
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.
Источник