Thursday, 14 May 2015

Config Heroku unicorn for WEB_CONCURRENCY

# Using
# ruby '2.1.3'
# 'rails', '4.1.8'
# 1. Test unicorn in background and check the RSS memory
heroku run bash
unicorn -c config/unicorn.rb & # Run unicorn in the background
ps euf # Read RSS value for each worker, in kb - ie: 116040 ~ 116mb
# USER PID %CPU %MEM VSZ RSS TTY STAT START TIME
# u41100 3 0.0 0.0 109116 2028 ? S 16:59 0:00
# u41100 4 0.0 0.0 109916 2760 ? R 16:59 0:00
# u41100 5 0.0 0.0 106504 1276 ? R+ 16:59 0:00
# each instance uses 200mb~
#2. Change the WEB_CONCURRENCY Based on dyno type
# example x1 (500mb RAM) change the worker_processes to 2
# worker_processes Integer(ENV["WEB_CONCURRENCY"] || 2)
# heroku change log https://devcenter.heroku.com/changelog-items/618
view raw gistfile1.sh hosted with ❤ by GitHub

No comments:

Post a Comment