Sha256: b8f4b7f666bff172466b688867e96826f3e832288185585e702a357c57e8bfd7

Contents?: true

Size: 925 Bytes

Versions: 2

Compression:

Stored size: 925 Bytes

Contents

  RAILS_ENV="<%= fetch(:rails_env) %>"

  process 'unicorn' do
    env rbenv_root: "<%= fetch(:rbenv_path) %>", rbenv_version: "<%=fetch(:rbenv_ruby) %>"
    pid_file "<%= fetch(:unicorn_pid) %>"
    start_command "<%= fetch(:rbenv_prefix) %> bundle exec unicorn -Dc <%= fetch(:unicorn_config_path) %> -E #{RAILS_ENV}"
    stdall "<%= fetch(:unicorn_log) %>"

    # stop signals:
    # http://unicorn.bogomips.org/SIGNALS.html
    stop_signals [:TERM, 10.seconds]

    # soft restart
    restart_command "kill -USR2 {PID}"

    check :cpu, :every => 30, :below => 80, :times => 3
    check :memory, :every => 30, :below => 150.megabytes, :times => [3,5]

    start_timeout 100.seconds
    restart_grace 30.seconds

    monitor_children do
      stop_command "kill -QUIT {PID}"
      check :cpu, :every => 30, :below => 80, :times => 3
      check :memory, :every => 30, :below => 150.megabytes, :times => [3,5]
    end
  end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
negroku-2.0.0.pre7 lib/negroku/templates/tasks/eye/_unicorn.erb
negroku-2.0.0.pre6 lib/negroku/templates/tasks/eye/_unicorn.erb