start new:
tmux
start new with session name:
tmux new -s myname
| # This will ride alongside god and kill any rogue memory-greedy | |
| # processes. Their sacrifice is for the greater good. | |
| unicorn_worker_memory_limit = 300_000 | |
| Thread.new do | |
| loop do | |
| begin | |
| # unicorn workers | |
| # |
| # http://unicorn.bogomips.org/SIGNALS.html | |
| rails_env = ENV['RAILS_ENV'] || 'production' | |
| rails_root = ENV['RAILS_ROOT'] || "/data/github/current" | |
| God.watch do |w| | |
| w.name = "unicorn" | |
| w.interval = 30.seconds # default | |
| # unicorn needs to be run from the rails root |
| # unicorn_rails -c /data/github/current/config/unicorn.rb -E production -D | |
| rails_env = ENV['RAILS_ENV'] || 'production' | |
| # 16 workers and 1 master | |
| worker_processes (rails_env == 'production' ? 16 : 4) | |
| # Load rails+github.git into the master before forking workers | |
| # for super-fast worker spawn times | |
| preload_app true |
| rails_root = "/data/github/current" | |
| 20.times do |num| | |
| God.watch do |w| | |
| w.name = "dj-#{num}" | |
| w.group = 'dj' | |
| w.interval = 30.seconds | |
| w.start = "rake -f #{rails_root}/Rakefile production jobs:work" | |
| w.uid = 'git' |