goperf

Go based Load Tester

  • 所有者: gnulnx/goperf
  • 平台:
  • 许可证:
  • 分类:
  • 主题:
  • 喜欢:
    0
      比较:

Github星跟踪图

goperf

A highly concurrant website load tester with a simple intuitive command line syntax.

Alt text

The header image shows goperf running on a 32 cpu machine. The machine being tested was a traditional web stack with a load balancer and 10 app servers.

Goperf fetches the html document as well as all the img, css, and js assets in an effort to realistically simulate a a basic browser request to your site. Support for follow up ajax requests is aimed for the next release

Goperf also supports simple http request headers like user-agent and cookies strings.

Prebuilt Binaries

Darwin 64 bit

Darwin 32 bit

FreeBSD 64 bit

FreeBSD 32 bit

Linux 64 bit

Linux 32 bit

Windows 64 bit

Windows 32 bit

Usage:

Fetch a page and display info.

./goperf -url {url} -fetch

This will print output like:

Alt text

To Fetch a page and display all it's assets use:

./goperf -url {url} -fetch --printjson

NOTE this will print the content of the body in each of the fetched assets. If you have large minified JS bundles it will be pretty messy. A future version will support only showing the body text

Fetch a page that requires a session id (such as a django login)

./goperf -url http://192.168.33.11/student/ -fetch -cookies "sessionid_vagrant=0xkfeev882n0i9efkiq7vmd2i6efufz9;" --printjson

Load testing

Tell goperf the number of users you want to simulate and the number of seconds you want the simulation to run.

./goperf -url {url} -users {int}  -sec {int}

Goperf will kick off a seperate go routine for each user. Each user will then continiously fetch the url along with all it's page assets in seperate go routines. Each users will make an initial GET request to fetch the cookies and then use them in follow up requests in order to simulate users sessions.

The light weight nature of goroutines allows this high concurancy to simulate many users with very litte memory. You will most likely overhewlm the test url servers or consume all of the available network bandwidth before memory becomes an issue.

Load testing results:

Alt text

Setup

Ensure gopath is correctly setup

Make sure you have your GOPATH setup to point to the go/bin directory.
If you have a default go install on ubuntu it would be ~/go/bin.
If so you would add this to your path.

export PATH=$PATH:~/go/bin

Install

go get github.com/gnulnx/goperf

Build

go install github.com/gnulnx/goperf

Run minimal unit and benchmark tests

go test ./... -cover -bench=.

Road map and future plans.

Currently goperf is quite good at simulating browser requests that include the body, css, img, and js assets.

However goper has no concept of an ajax request.

The next phase of goperf will be adding in support for additional requests after intial page load. For example say you wanted to time how long it took for 10 users to hit your website and also request a specific api. This approach will allow us to have much better simulation for javacsript heavy sites.

Longer term support for a chaos mode where the perf "users" move through the site randomly selecting a new url after each request.

主要指标

概览
名称与所有者gnulnx/goperf
主编程语言Go
编程语言Go (语言数: 3)
平台
许可证
所有者活动
创建于2017-11-04 22:31:11
推送于2021-03-24 13:31:46
最后一次提交2021-03-24 09:31:46
发布数0
用户参与
星数39
关注者数3
派生数4
提交数241
已启用问题?
问题数3
打开的问题数0
拉请求数1
打开的拉请求数0
关闭的拉请求数0
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?