Class: Stalin::Adapter::Unicorn

Inherits:
Rack
  • Object
show all
Defined in:
lib/stalin/adapter/unicorn.rb

Overview

A Stalin adapter that is suitable for use in Unicorn worker processes.

Constant Summary

Constants inherited from Rack

Rack::MB

Instance Method Summary collapse

Methods inherited from Rack

#call

Constructor Details

#initialize(app, min = 1024**3, max = 2*1024**3, cycle = 16, verbose = false) ⇒ Unicorn

Create a middleware instance.

Parameters:

  • app (#call)

    inner Rack application

  • min (Integer) (defaults to: 1024**3)

    lower-bound worker memory consumption before restart

  • max (Integer) (defaults to: 2*1024**3)

    upper-bound worker memory consumption before restart

  • cycle (Integer) (defaults to: 16)

    how frequently to check memory consumption (# requests)

  • verbose (Boolean) (defaults to: false)

    log extra information



11
12
13
# File 'lib/stalin/adapter/unicorn.rb', line 11

def initialize(app, min=1024**3, max=2*1024**3, cycle=16, verbose=false)
  super(app, :QUIT, :TERM, min, max, cycle, verbose)
end