Skip to main content

Running Load Tests on Microsoft Azure with IP Switching feature

One year ago I started to investigate how we could use Load Test feature that is available on Visual Studio 2013 Ultimate and Microsoft Azure on our own project. The main idea was to develop a mechanism to test complex scenarios (especially written in C#) that can simulate 10k, 20k and even 100k users.
The idea was accepted by client and we end up with a great and interesting application that can block a system witch worth millions. This is great from both sides. Mission complete for the team that defined the load tests, because they were able to define the load tests. But in the same time great for the development team and especially for the support team because they know the limits of the system.
Now, we stuck with another problem. Because we are using Microsoft Azure infrastructure to run Load Tests (having our own hardware would be to expensive), we cannot simulate calls from multiple IP address.
This is a current limitation Visual Studio Online - IP Switching feature is not yet available. What does this mean? Basically you cannot run/configure a Load Test from Visual Studio Online to use multiple IPs during load test.
At the beginning, this feature was not very important for us, but now we realize that we would like to have this ability.
What we could do?
Based on the feedback that we received, we have a pretty good option. We can configure Test Controllers and Test Agents for this purpose. We’ll need to create VMs on Microsoft Azure that will play the role of Test Agents. This machine will be uses to run the load tests. Because each machine has a different IP, it will be pretty simple to distribute the tests on this machines.
Next, I would like to go more dipper and discuss a little about this solution.
Let’s define two terms that appeared in the above paragraph. A Test Controller is the one that orchestrate all the load test. Is the one that send the tests to each node and wait the tests to run, collect the result and so on. A Test Agent is the node where the load tests are run. Test Agents represents the nodes that are used to run the tests.
The relationship between Test Controller and Test Agents is 1 to N. This means that we can have in a configuration one Test Controller that orchestrate the load tests, but we can have multiple Test Agents that will be used to run the tests.

It is important to know that one license of Visual Studio 2013 Ultimate it is enough for all this. You don’t need a different license for each Test Agent.
We can have different configurations. For example we can use only one machine that can play the role of Test Controller and Test Agent. Another option is to have Test Controller and Test Agents installed on different machines and Visual Studio installed only on the machine that is used by testers/developers to trigger the load test.
If you try to do something like this on Microsoft Azure don’t forget to open the port number 6901. This is the default port number uses by nodes for incoming calls. Don’t forget that all communication between the machine where Visual Studio is installed (machine from where the load test is triggered) and Test Agents is made through Test Controller.
Based on this information we should create VMs on Microsoft Azure that play the role of Test Controller and Test Agents. You can create and configure only one time and reuse them each time when you need it.
Useful links:

Comments

  1. Hello!
    What if you want to run more than 10K virtual users with IP Spoofing? How many Azure VMs should I create?

    Regards!

    ReplyDelete

Post a Comment

Popular posts from this blog

Windows Docker Containers can make WIN32 API calls, use COM and ASP.NET WebForms

After the last post , I received two interesting questions related to Docker and Windows. People were interested if we do Win32 API calls from a Docker container and if there is support for COM. WIN32 Support To test calls to WIN32 API, let’s try to populate SYSTEM_INFO class. [StructLayout(LayoutKind.Sequential)] public struct SYSTEM_INFO { public uint dwOemId; public uint dwPageSize; public uint lpMinimumApplicationAddress; public uint lpMaximumApplicationAddress; public uint dwActiveProcessorMask; public uint dwNumberOfProcessors; public uint dwProcessorType; public uint dwAllocationGranularity; public uint dwProcessorLevel; public uint dwProcessorRevision; } ... [DllImport("kernel32")] static extern void GetSystemInfo(ref SYSTEM_INFO pSI); ... SYSTEM_INFO pSI = new SYSTEM_INFO(...

How to audit an Azure Cosmos DB

In this post, we will talk about how we can audit an Azure Cosmos DB database. Before jumping into the problem let us define the business requirement: As an Administrator I want to be able to audit all changes that were done to specific collection inside my Azure Cosmos DB. The requirement is simple, but can be a little tricky to implement fully. First of all when you are using Azure Cosmos DB or any other storage solution there are 99% odds that you’ll have more than one system that writes data to it. This means that you have or not have control on the systems that are doing any create/update/delete operations. Solution 1: Diagnostic Logs Cosmos DB allows us activate diagnostics logs and stream the output a storage account for achieving to other systems like Event Hub or Log Analytics. This would allow us to have information related to who, when, what, response code and how the access operation to our Cosmos DB was done. Beside this there is a field that specifies what was th...

Cloud Myths: Cloud is Cheaper (Pill 1 of 5 / Cloud Pills)

Cloud Myths: Cloud is Cheaper (Pill 1 of 5 / Cloud Pills) The idea that moving to the cloud reduces the costs is a common misconception. The cloud infrastructure provides flexibility, scalability, and better CAPEX, but it does not guarantee lower costs without proper optimisation and management of the cloud services and infrastructure. Idle and unused resources, overprovisioning, oversize databases, and unnecessary data transfer can increase running costs. The regional pricing mode, multi-cloud complexity, and cost variety add extra complexity to the cost function. Cloud adoption without a cost governance strategy can result in unexpected expenses. Improper usage, combined with a pay-as-you-go model, can result in a nightmare for business stakeholders who cannot track and manage the monthly costs. Cloud-native services such as AI services, managed databases, and analytics platforms are powerful, provide out-of-the-shelve capabilities, and increase business agility and innovation. H...