A simple load testing tool using go.
There are tons of go load testing tools out there. This was something I built as I was learning go.
Make sure you have installed go runtime in your machine
Open a terminal/command prompt and run the below code which will install the go-load binary.
go get github.com/kshyju/go-load
- -c : Specifies the number of concurrent connections(goroutines) to use. You can consider this as the RPS you want for the test. Ex:
-c=50
will send 50 requests/second. - -d : Specifies the duration of the load test in seconds. Ex:
-d=30
will run the tests for 30 seconds. - -h : Specifies the request headers to send in a comma separated form. Each header item can use the
key:value
format. Ex:my-apikey:foo,cookie:uid
- -body : Specifies the path to the file name which has the request payload data present. go-load will read the content of this file and use that as the request body. When this option is passed, POST method will be used to send the request.
- -u : Specifies the request URL explicitly.
go-load -c 10 -d 30 https://www.bing.com
If you have special characters like &
in your URL, you need to pass the value in quotes.
go-load -c 10 -d 30 "https://www.bing.com?how=are&you=today"
Request headers can be passed as a comma separated string with the -h
flag. The string should have header key and value in the key:value
format. Ex: User-Agent:Go-http-client/1.1
go-load -c=10 -d=30 -h my-apikey:foo,cookie:uid:bar https://www.bing.com
The above example is sending 2 request headers, "my-apikey" and "cookie".
go-load -c=10 -d=30 -body="C:\\temp\\my-payload.json" "http://your.app/which/accepts/http-post?foo=bar"
To update to a newer version, you need to manually delete it in windows.
Go to %GOPATH%
(type %GOPATH%
in Start and open the directory). Go to src
and delete the go-load
directory under github
. I also deleted the go-load.exe
in bin directory in %GOPATH%