Load testing your web applications and services is an essential part of modern web development. There are many tools that can help you with that, for example Azure DevOps or Apache JMeter.
I am about to show you another tool, that you can run from your Windows PC. The tool is calledWebsurge and it’s build by Rick Strahl, who is a well known authority and a Microsoft MVP.
In essence, Websurge is a load testing tool for web applications. It comes as a Windows desktop application (with command-line engine) and is build with .NET Framework 4.5. Websurge is also open source!
If you go to the Websurge web site, you can read a lot about it. There is also a video which demonstrates the tool in more detail. My intention with this article is not to describe how it works, but to show you how I use it or what a potential use case would be. Before I continue, I should also mention, that WebSurge is free for personal use, but you should buy the professional version if you use it commercially (support the author!).
OK, so I started to play with Websurge few months ago. Installation and basic usage is pretty straight forward. I setup a .NET Core application to IIS on my local PC and experiment with Websurge. It’s an easy way to get familiar with the tool and after some time questions started to emerge in my head. Below are some questions I would like to elaborate on.
1. How to import a bunch of URLs to load test?
You can add HTTP requests to Websurge manually. But that is not very efficient on the long run. Tool comes with “WebSurge URL caption” module where you can navigate through your Web application or REST API and capture HTTP requests.
That’s great, but I need more. I generated my own .websurge files from a script, which connects to a database and generates REST API urls. For search endpoints I also generated the query parameters string with randomly generated but real data. This way the load tests are more similar to real requests that might hit the API. Below are the two examples of generated requests.
2. What happens if I replace local URL with remote ones (staging/production)?
The local testing is great, but real stuff happens in production. If you try to replace the requests to call remote API you are shown the pop-up below. First you need to validate, that you are the owner of the site:
After that you are able to run the load tests. Again, method of generating my custom .websurge file is very useful for smoke tests after the deployment or full blown load test.
3. Can I run the Websurge load testing from command-line?
You can use Websurge with CMD interface. An example is below.
At this stage my question was, can I put this to the release pipeline?
4. Can I run the Websurge load testing from Azure DevOps CD pipelines?
That is something I need to try. With a custom Agent host, this is probably achievable through some powershell scripting, but that is something for the next time :).
Ta-da!
Leave a Reply
You must belogged in to post a comment.