Skip to content

Instantly share code, notes, and snippets.

View FooBarWidget's full-sized avatar

Hongli Lai FooBarWidget

View GitHub Profile
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC25pwlRmDOdB9D1a1xWZBLqNo7PwIt1vEuM8Y298ZoLeXx0iOOoI6qxcBmeMZJJZ3v9rrtMD7zQ7ijg5JMa19cSx4MnxAGes/QjSso2SfbKPuKPRCvRNU6tNZ5vRKNJZxX3EmxeEjTkhKaF0kK1ja6cDEG9O3ldV28kHqcNXOVjBTzqLTfll2+XnXRUWAu0PBpzwhA1hsgzbofGWsYyclOTHk4Vjwb8u9EaUQPo40im7H/q/zATZi+S1oUxsnuMPdEGKVSNnrWZOQFvYY17EzJOnIwdwfCQjVoXJZzArlF46KVQwXvbcpkHga5KxusbGwZWbrt7ZgFuzgpRf62Ty/r hongli@hongli-lais-macbook-pro.local
# All times in this file are in UTC (GMT), not your local timezone. This is
# not a bug, so please don't ask about it. There is no portable way to
# store leases in the local timezone, so please don't request this as a
# feature. If this is inconvenient or confusing to you, we sincerely
# apologize. Seriously, though - don't ask.
# The format of this file is documented in the dhcpd.leases(5) manual page.
lease 172.16.210.236 {
starts 2 2014/02/11 11:14:31;
ends 2 2014/02/11 11:44:31;
@FooBarWidget
FooBarWidget / Unicorn edge cases.md
Created February 20, 2014 08:58
Unicorn edge cases

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 hand

def boolean_option(name, default_value = false)
value = ENV[name]
if value.nil? || value.empty?
return default_value
else
return value == "yes" || value == "on" || value == "true" || value == "1"
end
end
#ENV['USE_ASAN'] = '1'
import threading, traceback, signal, sys
def install_signal_handlers():
def debug(sig, frame):
id2name = dict([(th.ident, th.name) for th in threading.enumerate()])
code = []
for thread_id, stack in sys._current_frames().items():
code.append("\n# Thread: %s(%d)" % (id2name.get(thread_id,""), thread_id))
for filename, lineno, name, line in traceback.extract_stack(stack):
code.append(' File: "%s", line %d, in %s' % (filename, lineno, name))
554 5.7.1 Message cannot be accepted, content filter rejection REJECT - Body containing http.*\.nl (.nl TLD Spam)
private alpha (1 week):
bruikbaar voor ons, maar nog niet voor serieuze doeleinden omdat we nog een server missen.
- commando integreren: 2 dagen
- AWS provider: 1 dag
- andere dingen: 2
public alpha (2.5 weken):
- client packaging: 4 dagen
- OS X: 1 dag
- linux: 1 dag
<network>
<name>default</name>
<uuid>26f10cec-fe83-dc3f-2371-377c3c6b7028</uuid>
<forward mode='nat'/>
<bridge name='virbr0' stp='on' delay='0' />
<mac address='52:54:00:2C:9D:26'/>
<ip address='192.168.122.1' netmask='255.255.255.0'>
<dhcp>
<range start='192.168.122.2' end='192.168.122.254' />
<host mac='A2:90:13:94:0F:13' name='ci.phusion.nl' ip='192.168.122.10' />