Skip to content

Instantly share code, notes, and snippets.

@rtomayko
Created May 17, 2010 19:56
Show Gist options
  • Save rtomayko/404158 to your computer and use it in GitHub Desktop.
Save rtomayko/404158 to your computer and use it in GitHub Desktop.
GitHub RailsBench GC settings
#!/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