{"id":847,"date":"2019-10-29T17:00:52","date_gmt":"2019-10-29T11:30:52","guid":{"rendered":"https:\/\/www.hestabit.com\/blog\/?p=847"},"modified":"2021-10-14T13:21:39","modified_gmt":"2021-10-14T07:51:39","slug":"user-load-testing-the-nitty-gritties","status":"publish","type":"post","link":"https:\/\/www.hestabit.com\/blog\/user-load-testing-the-nitty-gritties\/","title":{"rendered":"User Load Testing: The Nitty-Gritties"},"content":{"rendered":"<p>Imagine you create an application in isolation, which fails to deliver when put against real-life scenarios. It will be a great downer, isn\u2019t it?<\/p>\n<p>So load testing is a \u2018One Step Ahead\u2019 solution, where the performance of an application is measured by creating an environment using a certain volume of users and real-life scenarios.<\/p>\n<p><strong>The purpose of load testing is to identify:<\/strong><\/p>\n<ul>\n<li>The optimum capacity (operational) of an application<\/li>\n<li>Sustainability of the infrastructure to run the application<\/li>\n<li>The capacity of the application to handle peak user load<\/li>\n<li>Scalability of the application, to increase the number of users accessing it.<\/li>\n<li>Number of concurrent users that an application can support<\/li>\n<\/ul>\n<h2>What is the need for Load Testing?<\/h2>\n<p>Even the most popular websites get overwhelmed by massive traffic and face downtime issues because they aren&#8217;t <a href=\"https:\/\/www.hestabit.com\/blog\/want-to-build-a-scalable-product-religiously-follow-these-tips\/\">scalable<\/a>.<\/p>\n<p>Let\u2019s take an example of E-commerce websites that put a lot of money in their advertising campaigns, but don\u2019t enough muscle for Load Testing.<\/p>\n<p>When their marketing efforts <a href=\"https:\/\/www.hestabit.com\/blog\/on-page-seo-tips-and-tricks\/\">bring a huge volume of traffic<\/a>, there have been instances where websites have failed to perform optimally.<\/p>\n<p><strong>Toysrus and Britannica faced the same fate.<\/strong><\/p>\n<p>Britannica made a promotional offer where they allowed free access to their online database. But they weren\u2019t able to handle the huge volume of traffic for weeks that resulted because of the offer.<\/p>\n<p>There are so many sites that experience delayed load times during heavy traffic.<\/p>\n<h2>Coming back to the question, why Load Testing?<\/h2>\n<p>The first and foremost objective of load testing is to identify the bottlenecks, which appear under stressful scenarios, like too many concurrent users. It\u2019s better to weed out such bottlenecks before an application goes into an environment where stakes are high.<\/p>\n<p>Moreover, you can determine the response time for each transaction, the individual performance of system components under different loads, and the network delay between the client and the server.<\/p>\n<p>But it\u2019s important to do your homework before putting <a href=\"https:\/\/www.hestabit.com\/mobile-app-development-company\">your application<\/a> under Load Test. In this regard, the most crucial metric is response time. So before you commence the process:<\/p>\n<ul>\n<li>Have a quantitative analysis of the response time<\/li>\n<li>Check whether the response time is relevant to your business process<\/li>\n<li>See whether the response time is realistic or not<\/li>\n<li>Make sure the response time is easily measurable using a stopwatch<\/li>\n<\/ul>\n<p>The bottlenecks you find depends entirely on the quality of simulation or how realistic it is.<\/p>\n<p>There are many variables that affect the quality of Load Test, with the most important being the number of concurrent users. Although there is no cap on the number of virtual users that you can have, load testing software is priced on the number of virtual users.<\/p>\n<p>So you need to have an idea of the \u2018Good Enough\u2019 number.<\/p>\n<h2>How many concurrent virtual users do we need?<\/h2>\n<p>It\u2019s not an easy task to zero in on this number. Let\u2019s understand what Virtual Users are.<\/p>\n<p>They are programs that behave like real users, by sending requests to an application. You can use any number of virtual users and create scenarios for them. You can select the browser, the connection speed, and fix other parameters using load testing tools.<\/p>\n<p>Each virtual user can have a specific set of parameters, or there can be common parameters for all virtual users of the group.<\/p>\n<p><strong>The equation between concurrent users and requests per user:<\/strong><\/p>\n<p>(concurrent users) x (requests per user per minute) = total requests per minute<\/p>\n<p>Let\u2019s take an example to understand the significance of this equation.<\/p>\n<p>Say there are 10,000 virtual users for a load test, with each of them making 3 requests per minute. So if we put these values in the above equation, you will get 30,000 requests per minute.<\/p>\n<p>Now the thing is, the cost of carrying out a load test is proportional to the number of virtual users. So if you reduce the number of virtual users and increase the number of request per second you can still get the same result. In other words, you can still hit the back end with the same number of requests.<\/p>\n<p><strong>Lets see some of the scenarios:<\/strong><\/p>\n<p>(10,000) x (3) = 30,000<br \/>\n(5,000) x (6) = 30,000<br \/>\n(1,000) x (30) = 30,000<br \/>\n(10) x (3,000) = 30,000<\/p>\n<h2>How many real users do you need?<\/h2>\n<p>It\u2019s always difficult to gauge real user-traffic for websites that haven&#8217;t launched yet.<\/p>\n<p>You can always go for a soft launch (beta) to understand user behavior. Not just that, you can get an idea of the traffic-volume as well as usage patterns.<\/p>\n<p>You can also do an analysis of similar websites. By doing this, you may realize that you are overdoing things and have resources that aren\u2019t needed. It\u2019s always better to get rid of the excess baggage in the initial stages.<\/p>\n<h2>Let\u2019s see some of the popular Load Testing Tools<\/h2>\n<h4><a href=\"https:\/\/locust.io\/\"><strong>1. Locust<\/strong><\/a><\/h4>\n<p>It\u2019s an open source framework that is Python-based. You can write performance scripts purely in Python. Primarily web applications and web-based services are tested using Locust, but if you have mastered Python scripting, anything can be tested then. Its simulations are based on \u2018Events Approach\u2019.<\/p>\n<p>This is why even on a laptop, you can simulate thousands of users. You can easily execute complicated scenarios having various steps.<\/p>\n<p>By the virtue of being Python-based, it\u2019s a cross-platform platform in nature. Due to its events based implementation, it\u2019s highly scalable.<\/p>\n<h4><a href=\"https:\/\/gatling.io\/\">2. Gatling<\/a><\/h4>\n<p>It\u2019s a free and open source performance testing tool, that has a basic GUI that&#8217;s limited to test recorder only.<\/p>\n<p>That said, you can use domain-specific language to develop tests that are easily readable and writable.<\/p>\n<p>It has a self-explanatory DSL for test development. Moreover, there are multiple input sources for data-driven tests.<br \/>\nIts assertion system is quite powerful and flexible at the same time. The load reports generated are a comprehensive and informative load.<br \/>\npeace<\/p>\n<h4><a href=\"https:\/\/jmeter.apache.org\/\">3. Apache Jmeter<\/a><\/h4>\n<p>It is a desktop application. The highlight of this tool is its user-friendly GUI, which makes developing tests and debugging very easy.<\/p>\n<p>It has been seen as a good alternative (open source) to solutions like LoadRunner.<\/p>\n<p>Its structure is modular, having plugin extensions. The plugins are developed by Apache Sofware Foundation as well as online contributors, which are incorporated as features.<\/p>\n<p>It is also <a href=\"https:\/\/www.hestabit.com\/hybrid-app-development\">cross-platform<\/a> in nature and can be run with Java on any operating system. It makes use of inbuilt as well as external listeners to analyze the test results.<\/p>\n<p>We hope this write-up gave you considerable insight into the process of load testing. Do share your views and queries in the comment section.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Imagine you create an application in isolation, which fails to deliver when put against real-life scenarios. It will be a great downer, isn\u2019t it? So load testing is a \u2018One Step Ahead\u2019 solution, where the performance of an application is measured by creating an environment using a certain volume of users and real-life scenarios. The purpose of load testing is to identify: The optimum capacity (operational) of an application Sustainability of the infrastructure to run the application The capacity of the application to handle peak user load Scalability of the application, to increase the number of users accessing it. Number of concurrent users that an application can support What is the need for Load Testing? Even the most popular websites get overwhelmed by massive traffic and face downtime issues because they aren&#8217;t scalable. Let\u2019s take an example of E-commerce websites that put a lot of money in their advertising campaigns, but don\u2019t enough muscle for Load Testing. When their marketing efforts bring a huge volume of traffic, there have been instances where websites have failed to perform optimally. Toysrus and Britannica faced the same fate. Britannica made a promotional offer where they allowed free access to their online database. But<a href=\"https:\/\/www.hestabit.com\/blog\/user-load-testing-the-nitty-gritties\/\" class=\"more_link more_link_dots\"> &hellip; <\/a><\/p>\n","protected":false},"author":3,"featured_media":1341,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"gallery","meta":{"footnotes":""},"categories":[450,47],"tags":[507,398,508,509],"yst_prominent_words":[476,503,472,470,480,473,475,466,474,478,483,471,468,465,477,481,469,224,467,479],"class_list":["post-847","post","type-post","status-publish","format-gallery","has-post-thumbnail","hentry","category-product-development","category-startup","tag-load-testing","tag-startups","tag-testing","tag-testing-tools","post_format-post-format-gallery"],"_links":{"self":[{"href":"https:\/\/www.hestabit.com\/blog\/wp-json\/wp\/v2\/posts\/847"}],"collection":[{"href":"https:\/\/www.hestabit.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hestabit.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hestabit.com\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hestabit.com\/blog\/wp-json\/wp\/v2\/comments?post=847"}],"version-history":[{"count":8,"href":"https:\/\/www.hestabit.com\/blog\/wp-json\/wp\/v2\/posts\/847\/revisions"}],"predecessor-version":[{"id":2680,"href":"https:\/\/www.hestabit.com\/blog\/wp-json\/wp\/v2\/posts\/847\/revisions\/2680"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.hestabit.com\/blog\/wp-json\/wp\/v2\/media\/1341"}],"wp:attachment":[{"href":"https:\/\/www.hestabit.com\/blog\/wp-json\/wp\/v2\/media?parent=847"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hestabit.com\/blog\/wp-json\/wp\/v2\/categories?post=847"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hestabit.com\/blog\/wp-json\/wp\/v2\/tags?post=847"},{"taxonomy":"yst_prominent_words","embeddable":true,"href":"https:\/\/www.hestabit.com\/blog\/wp-json\/wp\/v2\/yst_prominent_words?post=847"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}