No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Derek McQuay 296b2280e9
added TODO in readme
8 months ago
cmd/joked add configurability to buffer and throttle 8 months ago
vendor add tollbooth 8 months ago
Gopkg.lock add tollbooth 8 months ago
Gopkg.toml initial commit 8 months ago
LICENSE initial commit 8 months ago
README.md added TODO in readme 8 months ago
routes.go update comments and added info to /info/ 8 months ago
server.go update comments and added info to /info/ 8 months ago

README.md

joked

Creates a joke from two web services

Installing From Source

Clone the repo or if your $GOPATH is already set, run:

go get s.mcquay.me/dm/joke

Once there, you can install by running

$ go install joke/...

This will yield a binary called joked. joked comes with its own usage:

run joked with given options

Usage:
  app run [flags]

Flags:
  -b, --buffer int     size of jokes and name buffer (default 1000)
  -h, --help           help for run
  -n, --host string    hostname
  -p, --port int       port (default -1)
  -t, --throttle int   rate-limit HTTP requests (default 1000)

joked can be run by giving these flags values. For example:

$ joked run -b 10000 -t 1000

can withstand 1000 req/sec:

$ echo "GET http://localhost:8080" | vegeta attack -rate 1000 -duration 1m | vegeta report
Requests      [total, rate]            60000, 1000.02
Duration      [total, attack, wait]    59.999395469s, 59.998999776s, 395.693µs
Latencies     [mean, 50, 95, 99, max]  397.877µs, 407.908µs, 500.687µs, 560.541µs, 6.23341ms
Bytes In      [total, mean]            4575862, 76.26
Bytes Out     [total, mean]            0, 0.00
Success       [ratio]                  100.00%
Status Codes  [code:count]             200:60000
Error Set:

running:

joked run -b 50000 -t 10000

Tested up to 10000 req/sec running:

$ echo "GET http://localhost:8080" | vegeta attack -rate 10000 -duration 5s | vegeta report
Requests      [total, rate]            50000, 10000.20
Duration      [total, attack, wait]    5.00009964s, 4.999899906s, 199.734µs
Latencies     [mean, 50, 95, 99, max]  163.783µs, 150.931µs, 230.924µs, 368.169µs, 4.739964ms
Bytes In      [total, mean]            3811130, 76.22
Bytes Out     [total, mean]            0, 0.00
Success       [ratio]                  100.00%
Status Codes  [code:count]             200:50000
Error Set:

Make sure to have around ulimit -n 10240

Todo

  • Add metrics to better understand performance and other potential issues (prometheus)
  • Memory profile to better understand how the program behaves under pressure