Git Product home page Git Product logo

goperf's Introduction

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.

goperf's People

Contributors

gnulnx avatar jfurr avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.