Skip to content

Instantly share code, notes, and snippets.

@wijet
Last active December 17, 2015 16:59
Show Gist options
  • Save wijet/5643212 to your computer and use it in GitHub Desktop.
Save wijet/5643212 to your computer and use it in GitHub Desktop.
Configuration which makes puma leak file descriptors
require 'rack'
require 'rack/lobster'
run Rack::Lobster.new
defaults
log global
mode http
option httplog
option dontlognull
timeout client 10s
timeout server 10s
timeout connect 10s
listen lobster localhost:9000
balance roundrobin
server localhost:3000 localhost:3000 check
# haproxy version: 1.4.23 2013/04/03
# puma 2.0.1
# os: Linux 3.8-2-amd64 #1 SMP Debian 3.8.13-1 x86_64 GNU/Linux, also tested on OSX 10.8.3
$ haproxy -f haproxy.cfg
$ puma --port 3000 config.ru
$ ls /proc/PUMA_PID/fd -l | wc -l
# after some time, puma stops responding on port 3000
$ curl http://localhost:3000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment