Skip to content

Instantly share code, notes, and snippets.

@FooBarWidget
Created February 20, 2014 08:58
Show Gist options
  • Select an option

  • Save FooBarWidget/9109559 to your computer and use it in GitHub Desktop.

Select an option

Save FooBarWidget/9109559 to your computer and use it in GitHub Desktop.

Revisions

  1. FooBarWidget renamed this gist Feb 20, 2014. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. FooBarWidget renamed this gist Feb 20, 2014. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  3. FooBarWidget created this gist Feb 20, 2014.
    5 changes: 5 additions & 0 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    One example is that, by default, Unicorn requires 2x memory usage during a rolling restart. If you have 6 Unicorn worker processes, then during a rolling restart Unicorn will spawn *another* 6, and then replace the original 6 only after the new 6 have all been spawned. It is possible to perform rolling restart processes one-by-one (which requires dramatically less memory usage) but you have to write all sorts of configuration and scripts to do that.

    As for the edge cases: what happens if something fails during a rolling restart? For example if there is a temporary network problem to the database server, causing a process to fail to spawn. Unicorn will not handle it properly, and will continue to kill off the old processes even though no new ones can be spawned, causing downtime.

    Phusion Passenger Enterprise's rolling restart solves these issues nicely and elegantly. It does not require 2x memory usage, it does not require large scripts and configuration files, it does the right thing out of the box. It handles edge cases properly: if a process fails to start, it aborts the rolling restart, keeps the processes that you already had up until then, and notifies the administrator.