Demonstrate that queue time is not included in Unicorn's timeout
$ ruby unicorn_timeout_test.rb
starting unicorn {:worker_processes=>2, :timeout=>3}
[client] concurrently requesting /sleep/6, /sleep/4, /sleep/2, /sleep/0
| #!/bin/bash | |
| set -e -o pipefail -u | |
| # Launches each Procfile service as a tmux pane in a background window. | |
| # The window is created if it doesn't already exist. | |
| # Panes are created on demand, and existing panes are restarted if stopped. | |
| WINDOW_NAME="poorman" | |
| if [[ ${1:-} == "stop" ]]; then |
| haystack = { | |
| action: "greeting", | |
| scope: "world", | |
| things: [ | |
| { x: "city" }, | |
| { x: "country" }, | |
| { x: "world" }, | |
| ] | |
| } |
| #!/bin/bash | |
| set -e -o pipefail -u | |
| # Launches each Procfile service as a tmux pane in a background window. | |
| # The window is created if it doesn't already exist. | |
| # Panes are created on demand, and existing panes are restarted if stopped. | |
| WINDOW_NAME="goreman" | |
| tmux new-window -adS -n $WINDOW_NAME |
| PATTERN = %r{ | |
| ^ | |
| (?<indent>\s*) | |
| (?<key>\S+): | |
| \s* | |
| !InlineFile | |
| \s* | |
| (?<file>.*) | |
| $ | |
| }x |
Demonstrate that queue time is not included in Unicorn's timeout
$ ruby unicorn_timeout_test.rb
starting unicorn {:worker_processes=>2, :timeout=>3}
[client] concurrently requesting /sleep/6, /sleep/4, /sleep/2, /sleep/0
| source "https://rubygems.org" | |
| # ruby web server; run Sidekiq::Web with e.g. `puma --port=80` | |
| # https://github.com/puma/puma | |
| gem "puma" | |
| # provides Sidekiq::Web monitoring UI | |
| # https://github.com/mperham/sidekiq/wiki/Monitoring | |
| gem "sidekiq", "~> 4.2" |
| class RackHeaderRenamer | |
| # mapping example, sets/overwrites second header with first: | |
| # {"X-Varnish-Proto" => "X-Forwarded-Proto"} | |
| def initialize(app, mapping) | |
| @app = app | |
| @mapping = mapping | |
| end | |
| def call(env) |
| require "bcrypt" | |
| module GoTipping | |
| class UserAuthenticator | |
| def initialize(organisation, username, finder) | |
| @organisation = organisation | |
| @username = username | |
| @finder = finder | |
| end |
I hereby claim:
To claim this, I am signing this object:
| #!/usr/bin/env ruby | |
| require "open-uri" | |
| require "benchmark" | |
| def main | |
| urls = ARGV | |
| results = Queue.new |