Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Foreman - Process manager for applications with multiple components

4,382 views

Published on

Splitting an app up in different processes is great for performance and scalability. The downside, however, is that it becomes much more complicated to get the app and all of its parts running.
Foreman is an attempt to make this easier. Using foreman you can declare the various processes that are needed to run your application using a Procfile.

Published in: Technology
  • Be the first to comment

Foreman - Process manager for applications with multiple components

  1. 1. FOREMANProcess manager for applications with multiple components by Stoyan Zhekov
  2. 2. *file quiz
  3. 3. Rakefile
  4. 4. Rake
  5. 5. Gemfile
  6. 6. Bundler
  7. 7. Procfile
  8. 8. ?
  9. 9. Foreman
  10. 10. MATZ HEROKU
  11. 11. HEROKU + FOREMAN
  12. 12. Foreman
  13. 13. PROBLEM ?
  14. 14. Too complicated applications
  15. 15. XMPP Bot (Blather)
  16. 16. XMPP Bot Web Frontend (Blather) (Rails)
  17. 17. XMPP Bot Web Frontend (Blather) (Rails)TWT Stream(Event Machine)
  18. 18. XMPP Bot Web Frontend (Blather) (Rails)TWT Stream API(Event Machine) (Sinatra)
  19. 19. XMPP Bot Web Frontend (Blather) (Rails)TWT Stream API(Event Machine) (Sinatra) BGND Jobs (Resque)
  20. 20. XMPP Bot Web Frontend (Blather) (Rails)TWT Stream API(Event Machine) (Sinatra) BGND Jobs Cronjobs (Resque) (Clockwork)
  21. 21. HOW TO START THEM?• rails: rails server thin -p $PORT
  22. 22. HOW TO START THEM?• rails: rails server thin -p $PORT• api: rackup -s thin -p $PORT -E production
  23. 23. HOW TO START THEM?• rails: rails server thin -p $PORT• api: rackup -s thin -p $PORT -E production• bot: ruby jabber_bot.rb -D
  24. 24. HOW TO START THEM?• rails: rails server thin -p $PORT• api: rackup -s thin -p $PORT -E production• bot: ruby jabber_bot.rb -D• cron: clockwork clock.rb
  25. 25. HOW TO START THEM?• rails: rails server thin -p $PORT• api: rackup -s thin -p $PORT -E production• bot: ruby jabber_bot.rb -D• cron: clockwork clock.rb• jobs: QUEUE=* rake resque:work
  26. 26. HOW TO START THEM?• rails: bundle exec rails server thin -p $PORT• api: bundle exec rackup -s thin -p $PORT• bot: bundle exec ruby jabber_bot.rb -D• cron: bundle exec clockwork clock.rb• jobs: QUEUE=* bundle exec rake resque:work
  27. 27. Nightmare !
  28. 28. Foreman
  29. 29. PROCFILErails: bundle exec rails server thin -p $PORTapi: bundle exec rackup -s thin -p $PORTbot: bundle exec ruby jabber_bot.rb -Dcron: bundle exec clockwork clock.rbjobs: QUEUE=* bundle exec rake resque:work
  30. 30. foreman start
  31. 31. IT JUST WORKS!
  32. 32. NOT ONLY RUBYnode: node web.jsclojure: lein run -m...
  33. 33. DOES IT SCALE? foreman start-c web=5,job=2
  34. 34. OS INTEGRATION$ sudo foreman export upstart /etc/init -a myapp[foreman export] writing: /etc/init/myapp.conf[foreman export] writing: /etc/init/myapp-web.conf[foreman export] writing: /etc/init/myapp-web-1.conf$ sudo start myapp
  35. 35. Thank you!

×