Skip to content

Instantly share code, notes, and snippets.

@leandro
Forked from rtomayko/unicorn_github
Created May 17, 2010 20:12
Show Gist options
  • Save leandro/404175 to your computer and use it in GitHub Desktop.
Save leandro/404175 to your computer and use it in GitHub Desktop.
#!/bin/sh
# Usage: unicorn_github
# Script used to start unicorn in GitHub staging and production environments.
# This is called primarily by god.
set -e
# configure GC settings
export RUBY_HEAP_MIN_SLOTS=800000
export RUBY_HEAP_FREE_MIN=100000
export RUBY_HEAP_SLOTS_INCREMENT=300000
export RUBY_HEAP_SLOTS_GROWTH_FACTOR=1
export RUBY_GC_MALLOC_LIMIT=79000000
: ${RAILS_ROOT:=$(dirname $(dirname $0))}
: ${RAILS_ENV:=production}
export RAILS_ROOT RAILS_ENV
cd $RAILS_ROOT
exec /usr/local/bin/unicorn_rails -c "$RAILS_ROOT/config/unicorn.rb" -E "$RAILS_ENV" -D
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment