Usually, we rely on Google Analytics for gathering data about traffic. You can find the source of traffic and time of sessions. Since Google Analytics is great for seeing users, you can eliminate the guesswork from load test. By analyzing the user data, you can create realistic load tests.
Google Analytics helps in tracking new visitors “Users” and how much time they spend on your site. They perform actions (page loads, AJAX requests) which can load your servers. For estimating the concurrent visitors at any one time, you can use the below-mentioned formula to calculate sizing of tests:
Concurrent Virtual Users = “Hourly Sessions X Average Session Duration (in secs) / 3600”
Where to Get Data From in Google Analytics?
- Login to Google Analytics account.
- Click the “Reporting” tab.
- Select “Audience” from the sidebar menu.
- Click “Overview”.
- Set the time period for which you want the data.
After you have the data, you need to design a load test.
Design a Load Test
- Check your site during peak hours of traffic in Google Analytics
- Figure out how many sessions are there
- Perform a test that generates a similar amount of load/traffic.
Note: While performing a load test, add some margins too just to ensure your servers can handle higher traffic levels too.
Why find peak traffic and not just average?
Mostly, average traffic will be low. Sites usually have regular, recurring peak periods where they experience 2x or more the average traffic levels. Therefore, it is important to test for that peak traffic.
Reasons for extreme traffic peaks
- There are some sites that have occasional extreme traffic peaks probably due to the nature of the site. For instance, a site declaring the result of XII class or a site selling concert tickets released at a certain date and time.
- User behavior can also impact the spikes. For example, you have a breakfast recipe site. This means most if the visitors will come to your site just before breakfast. There are possibilities that your site can have peaks much higher than 10x against the average for the site. Therefore, it becomes very important to load test at traffic levels way beyond the averages to ensure your servers don’t end up burning.
Analyze the data
Here’s an example from one of our client’s data.
The site averaged 31.815 concurrent sessions for the entire month.
- 1889337 monthly sessions X 38 seconds per session / 3600 = 19943.001
- 19943.001 / 720 (30 days in June X 24h per day = 720) = 27.698 average concurrent users in June
However, if you calculate the average concurrent sessions for just Jun 29, you will get 31.815 – which is more than the average concurrent users.
Also, if you calculate the average concurrent sessions between 8 PM and 9 PM on that day when there are more users, the average concurrent sessions is 41.4808. This is almost 2x than the monthly average concurrent users.
- While designing your load test, look at the right numbers and right time frames.
- Even if you don’t have an exceptional spike just like above, there are chances that you will still see temporary peaks. Therefore, spike tests are always a good idea before you start funding, roll out new features or just need to be prepared.
Bonus Tip: If you are stuck on performance and load tests, there’s a high chance we have worked in the similar situation before. Having 8+ years of experience in the industry working with companies of every size across the globe, we can help you with a load test.
You can simply schedule a FREE consultation with our experts.