Skip to content

suhlig/nginx-timeout-spike

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nginx + puma = scale

A minimal Sinatra application fronted by nginx. Both communicate via Unix Domain Sockets, which should be more efficient than HTTP.

Install Dependencies (once)

# Install OS packages like nginx
$ brew bundle

# Install rubygems
$ bundle install

Also install foreman, but not as part of the Gemfile (on purpose):

$ gem install foreman

Start

$ foreman start

In order to determine the port instead of letting foreman auto-select it, pass it as parameter:

$ foreman start -p 7890

Test

$ curl -vvv localhost:5000/
…
# stream content for five seconds
$ curl -vvv localhost:5000/stream?t=5
…
# wait five seconds before returning the result
$ curl -vvv localhost:5000/slow?t=5

Stress Test

# start stress test
wrk --threads 12 --connections 60 --duration 60s --timeout 10 http://127.0.0.1:5000/stream?t=2

# see puma stats
curl http://127.0.0.1:9293/stats?token=foo

Notes

About

A spike to explore nginx' timeouts

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published