Cross platform HTTP Server benchmark tool written in .NET 6.0. Declarative and easy to use. Execute test cases and compare the results. Parallelize the execution of test cases.
Runs on MacOS, Linux and Windows. For additional information see all supported platforms.
dotnet tool install --global webben
webben [command] [options]
Commands:
config <fileInfo>
uri <uri>
analyse, analyze <uri>
Options:
-v, --verbose Enable verbose output
-e, --export-format <Default|Json> Export format [default: Default]
-?, -h, --help Show help and usage information
Example:
webben config <filePath>
Output:
โญโโโโโโโโโโโโโโฌโโโโโโโโฌโโโโฌโโโโฌโโโโฌโโโโโโโโโฌโโโโโโโโโโโฌโโโโโโโโโโโฎ
โName โElapsedโNoRโPllโErrโAvg(ms) โStdDev(ms)โMedian(ms)โ
โโโโโโโโโโโโโโโผโโโโโโโโผโโโโผโโโโผโโโโผโโโโโโโโโผโโโโโโโโโโโผโโโโโโโโโโโค
โget_simple_1 โ2.13 โ100โ100โ0 โ2,083.83โ11.66 โ2,080.86 โ
โget_simple_2 โ2.03 โ100โ100โ0 โ2,017.24โ7.21 โ2,017.62 โ
โpost_simple_1โ2.09 โ100โ500โ0 โ2,022.46โ5.07 โ2,020.69 โ
โฐโโโโโโโโโโโโโโดโโโโโโโโดโโโโดโโโโดโโโโดโโโโโโโโโดโโโโโโโโโโโดโโโโโโโโโโโฏ
webben uri <uri> [options]
Arguments:
<uri> The URI to use.
Options:
-f, --fetch-content Whether to fetch the content of the URI.
-l, --name Name or label
-m, --http-method The HTTP method to use.
-n, --request-count The number of requests to make.
-p, --parallelism The number of parallelism to use.
-r, --allow-redirect Whether to allow redirects.
-t, --timeout-in-ms The timeout in milliseconds.
Examples:
webben uri http://localhost:3000
webben uri http://localhost:3000 -n 10000
webben uri http://localhost:3000 -p 100 -b 50 -t 5000 -m GET -f false -r false -n 10000
Output:
โญโโโโโโโโโโโโโโโฌโโโโโโโโฌโโโโฌโโโโฌโโโโฌโโโโโโโโฌโโโโโโโโโโโฌโโโโโโโโโโโฎ
โName โElapsedโNoRโPllโErrโAvg(ms)โStdDev(ms)โMedian(ms)โ
โโโโโโโโโโโโโโโโผโโโโโโโโผโโโโผโโโโผโโโโผโโโโโโโโผโโโโโโโโโโโผโโโโโโโโโโโค
โinitial_test_1โ0.67 โ10 โ100โ0 โ456.69 โ82.85 โ423.60 โ
โฐโโโโโโโโโโโโโโโดโโโโโโโโดโโโโดโโโโดโโโโดโโโโโโโโดโโโโโโโโโโโดโโโโโโโโโโโฏ
Usage:
webben analyze <uri> [options]
webben analyse <uri> [options]
Arguments:
<uri> The URI to use.
Options:
-f, --fetch-content Whether to fetch the content of the URI.
-r, --allow-redirect Whether to allow redirects.
-t, --timeout-in-ms <timeout-in-ms> The bounded capacity to use.
-m, --max-trial-count <max-trial-count> Iteration count for calculation. See -c
-c, --calculation-function <Average|Median|P70|P80|P90> Function for RPS calculation
Examples:
analyze "https://contoso.com/?q=test"
analyze "https://contoso.com/?q=test" -c Median
analyze "https://contoso.com/?q=test" -m 5 -c P80
Output:
# Analyze result including max requests count per second
โญโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโฌโโโโฌโโโโฌโโโโฌโโโโโโโโฌโโโโโโโโโโโฌโโโโโโโโโโโฎ
โName โElapsed(sec)โNoRโPllโErrโAvg(ms)โStdDev(ms)โMedian(ms)โ
โโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโผโโโโผโโโโผโโโโผโโโโโโโโผโโโโโโโโโโโผโโโโโโโโโโโค
โ2206260057093580โ0.52 โ1 โ1 โ0 โ503.35 โ0.00 โ503.35 โ
โ2206260057093580โ0.29 โ2 โ2 โ0 โ283.28 โ1.34 โ283.28 โ
โ2206260057093580โ0.29 โ4 โ4 โ0 โ282.62 โ11.45 โ286.21 โ
โ2206260057093580โ0.29 โ8 โ8 โ0 โ280.83 โ8.95 โ284.91 โ
โ2206260057093580โ0.36 โ16 โ16 โ0 โ316.97 โ19.17 โ317.60 โ
โ2206260057093580โ0.71 โ32 โ32 โ0 โ658.79 โ30.66 โ661.04 โ
โ2206260057093580โ0.60 โ64 โ64 โ0 โ503.19 โ59.68 โ492.96 โ
โ2206260057093580โ0.86 โ128โ128โ0 โ707.93 โ87.33 โ723.58 โ
โ2206260057093580โ1.63 โ256โ256โ0 โ997.16 โ161.11 โ997.03 โ
โ2206260057093580โ1.14 โ129โ129โ0 โ728.80 โ72.92 โ724.38 โ
โฐโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโดโโโโดโโโโดโโโโดโโโโโโโโดโโโโโโโโโโโดโโโโโโโโโโโฏ
โญโโโโโโโฎ
โMaxRPSโ
โโโโโโโโค
โ 128 โ
โฐโโโโโโโฏ
{
"TestCaseConfigurations": [
{
"Name": "get_simple_1",
"Uri": "http://localhost:3000/api/v1/posts/foo"
},
{
"Name": "get_simple_2",
"Uri": "http://localhost:3000/api/v1/posts/bar"
},
{
"Name": "post_simple_1",
"Uri": "http://localhost:3000/api/v1/posts",
"HttpMethod": "POST",
"NumberOfRequests": 500,
"FetchContent": false,
"Parallelism": 500,
"BoundedCapacity": 500,
"Headers": {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64)"
},
"Cookies": {
"X-Session-Id": "44c00ac0-eae8-11ec-8fea-0242ac120002"
},
"Body": {
"Content": "{\"name\":\"test\"}",
"ContentType": "application/json",
"Encoding": "utf-8"
}
}
]
}
./webben config samples/Multiple.json
โญโโโโโโโโโโโโโโฌโโโโโโโโฌโโโโฌโโโโฌโโโโฌโโโโโโโโโฌโโโโโโโโโฌโโโโโโโโโฎ
โName โElapsedโNoRโPllโErrโAvg โP90 โMedian โ
โโโโโโโโโโโโโโโผโโโโโโโโผโโโโผโโโโผโโโโผโโโโโโโโโผโโโโโโโโโผโโโโโโโโโค
โget_simple_1 โ2.13 โ100โ100โ0 โ2,081.37โ2,078.92โ2,078.47โ
โget_simple_2 โ2.03 โ100โ100โ0 โ2,015.18โ2,025.14โ2,013.66โ
โpost_simple_1โ2.08 โ100โ500โ0 โ2,019.53โ2,023.18โ2,019.60โ
โฐโโโโโโโโโโโโโโดโโโโโโโโดโโโโดโโโโดโโโโดโโโโโโโโโดโโโโโโโโโดโโโโโโโโโฏ
./webben config samples/Multiple.json -e Json
[{
"Configuration": {
"HttpMethod": "GET",
"RequestCount": 100,
"Parallelism": 100,
"UseDefaultCredentials": false,
"UseCookieContainer": false,
"MaxBufferSize": 2147483647,
"Name": "get_simple_1",
"Uri": "http://localhost:3000/api/v1/posts/foo",
"FetchContent": false,
"AllowRedirect": false,
"TimeoutInMs": 2147483647
},
"Timings": [
"00:00:02.0780162",
"...",
"00:00:02.0726471"
],
"Errors": [],
"Elapsed": "00:00:02.1292561"
},
{
"Configuration": {
"HttpMethod": "GET",
"RequestCount": 100,
"Parallelism": 100,
"UseDefaultCredentials": false,
"UseCookieContainer": false,
"MaxBufferSize": 2147483647,
"Name": "get_simple_2",
"Uri": "http://localhost:3000/api/v1/posts/bar",
"FetchContent": false,
"AllowRedirect": false,
"TimeoutInMs": 2147483647
},
"Timings": [
"00:00:02.0278468",
"...",
"00:00:02.0277827"
],
"Errors": [],
"Elapsed": "00:00:02.0749580"
}]
Support for authentication, cookie containers, and default credentials. It is possible to use the same credential
configuration for multiple test cases. The credential configuration is specified by the CredentialConfigurationKey
property.
{
"CredentialConfigurations": [
{
"Key": "cred_1",
"Provider": "NetworkCredentialProvider",
"Data": {
"username": "foo",
"password": "bar"
}
}
]
}
Http request headers can be specified.
{
"TestCaseConfigurations": [
{
"Name": "post_simple_1",
"Uri": "http://localhost:3000",
"HttpMethod": "POST",
"NumberOfRequests": 10000,
"FetchContent": false,
"Parallelism": 500,
"BoundedCapacity": 500,
"Headers": {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64)"
},
"Body": {
"Content": "{\"name\":\"test\"}",
"ContentType": "application/json",
"Encoding": "utf-8"
}
}
]
}
Http requests created by WebBen are not actually sent to the server. Instead, they are stored in a queue. The queue is processed by multiple threads depending on the parallelism.
POST / HTTP/1.1
Host: localhost:3000
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) WebBen/1.2206
Content-Type: application/json; charset=utf-8
Content-Length: 15
{"name":"test"}
WebBen is just a simple tool to generate http requests. You can combine it with other tools to make more complex tasks. For example, you can use WebBen to generate requests and then use another tool to send them to the your backend.
webben uri https://url-to-benchmark.local/pages/1 -e json | \
curl -H "Content-Type: application/json" \
-X POST \
--data-binary @- \
https://your-awesome-backend.local/api/v1/posts
POST / HTTP/1.1
Host: your-awesome-backend.local
User-Agent: curl/7.79.1
Accept: */*
Content-Type: application/json
Content-Length: 1042
{
"Items": [
{
"Timings": [
"00:00:00.5772976",
"00:00:00.5528780",
"00:00:00.5148466",
"00:00:00.5118757",
"00:00:00.5118554",
"00:00:00.4524819",
"00:00:00.5113236",
"00:00:00.5117843",
"00:00:00.5148185",
"00:00:00.4524458"
],
"Errors": [],
"Elapsed": "00:00:00.5938226",
"Configuration": {
"HttpMethod": "GET",
"RequestCount": 10,
"Parallelism": 10,
"UseDefaultCredentials": false,
"UseCookieContainer": false,
"MaxBufferSize": 2147483647,
"Name": "iteration1",
"Uri": "https://url-to-benchmark.local/pages/1",
"FetchContent": false,
"AllowRedirect": true,
"TimeoutInMs": 2147483647
},
"Calculations": {
"Average": "00:00:00.5111607",
"StdDev": "00:00:00.0361018",
"P90": "00:00:00.5772976",
"P80": "00:00:00.5528780",
"P70": "00:00:00.5148466",
"Median": "00:00:00.5118655"
}
}
]
}
Have an idea? Found a bug? Contributions are always welcome.
- Open an issue or create a pull request.
- Share with your friends.
- Give a Star.
Thanks! โค๏ธ