testing - How do I calculate the number of concurrent users to use in a load test? -
we’ve come across question @ load impact, thought i’d add stack overflow community make easier find.
how calculate number of concurrent users (vus) need simulate during load test, in order stress system same kind of traffic see in course of month, week or day?
running load test requires specify how many concurrent users should simulated during testing. in other words, how many simulated users active, loading things or interacting site/app @ same time. unfortunately, when looking @ google analytics example, see how many visits website has per day or per month. site can have million visits per month, still ever experience max 100 concurrent visitors.
to convert "visits per x" metric google analytics, or other analytics system, "concurrent users" metric can use load testing, can use following method.
first, find out 2 things:
you need total number of visits short time period when site/app @ peak traffic levels. can found via e.g. google analytics seeing highest number of visits single hour in course of e.g. month. @ day has seen highest number of visits, , drill down see hour of day busiest , how many visits had during hour. note value down. call value "peak_hourly_visits" in text.
you need know average time user spends interacting site/app. in google analytics called "average session duration" , call in text also, called "average time on site". if value changes lot site/app depending on time period @ might want use 1 of larger values find, on safe side. want times in seconds, if e.g. google analytics tells "00:03:19" (3 minutes, 19 seconds) should note down 199 average session duration.
when have 2 values use formula calculate number of concurrent users use in load test:
concurrent_users = (peak_hourly_visits * average_session_duration) / 3600
provided each simulated user (vu) in load test behaves realistically (i.e. simulates real user well), able stress site/app same kind of traffic sees during peak traffic hours.
Comments
Post a Comment