Monday 22 June 2020

Asp.net Core Performance testing using Bombardier

Before staring this blog, i would like to describe the basic of DotNet tool, it will not take more than minutes.

dotnet tools

To simplify .net core work by using cli on Machine or in Path we use dotnet tools.
Ex:
  • dotnet-counters
  • dotnet-ef
  • dotnet-reportgenerator-globaltool
Basic commands:
  • dotnet tool install --global <PACKAGE_NAME>
  • dotnet tool list -g|--global
  • dotnet tool run <COMMAND NAME>
  • dotnet tool uninstall <PACKAGE_NAME> -g|--global
  • dotnet tool update <PACKAGE_NAME> -g|--global
Let's have a look on a tool and It's uses:

dotnet-counters

Is used to monitor and collect diagnostic info of a running process. More could be found here on Stefan Geiger blog and Official Microsoft site.
Installation: dotnet tool install --global dotnet-counters
Monitoring: dotnet counters monitor --process-id 17264 --providers Microsoft.AspNetCore.Hosting System.Runtime

Now its good to start performance testing part from main topic. As we already know how to check various counter matrices using dotnet-counters while we will be using Bombardier.

Bombardier, Is an open source tools to make flood of http1/http2 request with various options using cli. It is written in GO programming, thus we required GO executable to understand GO command.

Installation:
go get -u github.com/codesenberg/bombardier

Execution:
bombardier -c 125 -n 10000 http://localhost:51976/api_documentation/index/index.html

Must have a look on powerful Bombardier's command.

After successful execution we can find statistics like this