{"id":66768,"date":"2023-02-16T14:55:46","date_gmt":"2023-02-16T13:55:46","guid":{"rendered":"https:\/\/www.microsoft.com\/en-gb\/industry\/blog\/?p=66768"},"modified":"2023-07-25T17:43:39","modified_gmt":"2023-07-25T16:43:39","slug":"how-you-should-be-load-testing-your-background-services","status":"publish","type":"post","link":"https:\/\/www.microsoft.com\/en-gb\/industry\/blog\/technetuk\/2023\/02\/16\/how-you-should-be-load-testing-your-background-services\/","title":{"rendered":"How you should be load testing your background services"},"content":{"rendered":"\n
Like many developers, I have followed or attempted to follow best practices and patterns when building APIs and services. Then when it comes to deployment, I deploy my API to my favourite infrastructure on Azure, picked an appropriate SKU and left it there. The use of load testing tools was seen something someone else could do or something a little too specialist for me or complicated for me. But there was always this niggling feeling that what I had built may not perform well enough.<\/p>\n\n\n\n
Load testing is a vital step in the lifecycle of a service – for a team to know<\/em> that their service can take the load required of it.<\/p>\n\n\n\n With the advent of Azure Load Testing, almost all of the infrastructural challenges of building load tests have been removed. You just have to be able to write or adapt JMeter JMX files and upload them into a load test. I recommend looking at this tutorial<\/a> for how to use Azure load testing against a web app.<\/p>\n\n\n\n The use of load testing means it is now quite straightforward to test web apps and APIs, but it is less clear how to effectively load test and monitor a background or asynchronous service and to know when all of the background processing has completed and also that all requests have been processed correctly.<\/p>\n\n\n\n This repository contains an Azure Load Testing sample that tests and monitors an asynchronous service. This is supplied with a sample application against which the load test can be run. This sample application comprises some APIs which push messages to a queue and then later processes these messages from the queue.<\/p>\n\n\n\n This test:<\/p>\n\n\n\n In this way, the load test executes for as long as it takes to process all of the data and the load test can then pull in the custom metric to graph the items remaining to be processed into the load test results. Thus giving the tester a more complete picture of how long an asynchronous process takes to complete a given number of requests.<\/p>\n\n\n\n<\/a>Azure Load Test to the rescue<\/h2>\n\n\n\n
<\/a>What is special about background processes?<\/h2>\n\n\n\n
<\/a>How does load testing solve these problems?<\/h2>\n\n\n\n
\n
<\/a>Load Test Structure<\/h2>\n\n\n\n