Skip to content

Marvin9/api-load-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

api-load-test

simple and elegant load testing tool.

Development

git clone https://github.com/Marvin9/api-load-test
cd api-load-test
make build
./bin/api-load-test --endpoint "YOUR_API_ENDPOINT" --method "GET" --rate 10 --until 10
  • To list available flags
./bin/api-load-test --help

Usage:
  loadtest [flags]

Flags:
  -e, --endpoint string   target endpoint. eg: http://locahost:8000/
  -h, --help              help for loadtest
  -m, --method string     method of target endpoint [GET/POST/PUT...] (default "GET")
  -r, --rate int          load of requets per second (default 100)
  -u, --until int         duration of load in seconds (default 10)

Run using docker

  • build

    docker build -t api_load_test .
    
  • run

    docker run --rm -it --ulimit nofile=<softlimit>:<hardlimit> api_load_test --endpoint="http://ip:port/endpoint" --rate 100 --until 5
    

    ulimit

  • accessing localhost from container

    • For MacOS: --endpoint="http://docker.for.mac.host.internal:port/"

Limitations

--rate of requests will be dependent on the available file descriptors ulimit -n, processes ulimit -u and the round trip time of request. In short number of rate should not exceed certain limit.

About

experiment to test performance of an API.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published