Bráulio Bhavamitra | 4 Dec 22:15 2014

Show request details on timeout killing

Hello all,

Currently, unicorn kills a worker that reached timeout with the
following message:
E, [2014-12-04T19:12:23.646053 #32612] ERROR -- : worker=4 PID:11911
timeout (61s > 60s), killing

How can I see which URL was being processed by that worker?

I need to identify the problematic request.


Bráulio Bhavamitra | 3 Dec 10:50 2014

No, passenger 5.0 is not faster than unicorn :)

Hello all,

I've just tested a one instance each (one worker with unicorn and
--max-pool-size 1 passenger 5) on the rails app I work.

And the results are just as I expected, no miracle at all: Unicorn is
still the fatest!
(the difference is only a few milliseconds less per request)

The blocking design of unicorn is proving itself very efficient.


Jérémy Lecour | 2 Dec 12:21 2014

worker freeze and strace interpretation


I've been trying to debug a weird situation on a Rails app (4.1) using
Unicorn (4.8.3).
Sometimes, some requests are hanging and I can't find why.

I've hooked "strace" to the workers and I have a lot of lines with
"Resource temporarily unavailable" and I wonder if it's normal.

Here is a snippet :

11587 write(7, "\27\3\3\1\253\36\274d\263\340\375\250d\374~X\364\306^\227{F\357~\223\347\245M\351-\360\301"...,
432 <unfinished ...>
11581 read(3,  <unfinished ...>
11587 <... write resumed> )             = 432 <0.000016>
11581 <... read resumed> 0x7f5b04878cc0, 1024) = -1 EAGAIN (Resource
temporarily unavailable) <0.000012>
11581 read(5,  <unfinished ...>
11587 write(7, "\27\3\3\t`+\22zIY\242\252L\346?n\245!\347c\251\341\fo\202Is\346\23\10\320\34"...,
2405 <unfinished ...>
11581 <... read resumed> "!", 1024)     = 1 <0.000016>
11587 <... write resumed> )             = 2405 <0.000015>
11581 read(5, 0x7f5b04878cc0, 1024)     = -1 EAGAIN (Resource
temporarily unavailable) <0.000014>
11587 read(7,  <unfinished ...>
11581 poll([{fd=3, events=POLLIN}], 1, 100 <unfinished ...>
11587 <... read resumed> 0x7f5af47c0123, 5) = -1 EAGAIN (Resource
temporarily unavailable) <0.000009>
11587 futex(0x7f5b04885054, FUTEX_WAKE_OP_PRIVATE, 1, 1,
0x7f5b04885050, {FUTEX_OP_SET, 0, FUTEX_OP_CMP_GT, 1}) = 1 <0.000005>
(Continue reading)

Eric Wong | 27 Nov 23:46 2014

[PATCH] http_server: save 450+ bytes of memory on x86-64

Replacing the Regexp argument to a rarely-called String#split with a
literal String can save a little memory.  The removed Regexp memsize
is 469 bytes on Ruby 2.1:

	ObjectSpace.memsize_of(/,/) => 469

Is slightly smaller at 453 bytes on 2.2.0dev (r48474).
These numbers do not include the 40-byte object overhead.

Nevertheless, this is a waste for non-performance-critical code
during the socket inheritance phase.  A literal string has less
overhead at 88 bytes:

	* 48 bytes for table entry in the frozen string table
	* 40 bytes for the object itself

The downside of using a literal string for the String#split argument
is a 40-byte string object gets allocated on every call, but this
piece of code is only called once in a process lifetime.
 lib/unicorn/http_server.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/unicorn/http_server.rb b/lib/unicorn/http_server.rb
index 819a0a8..69bf362 100644
--- a/lib/unicorn/http_server.rb
+++ b/lib/unicorn/http_server.rb
 <at>  <at>  -770,7 +770,7  <at>  <at>  class Unicorn::HttpServer
   def inherit_listeners!
     # inherit sockets from parents, they need to be plain Socket objects
(Continue reading)

Светлана | 13 Jul 15:30 2014

По поводу закупок

Здравствуйте! Меня зовут Светлана.

Сообщите пожалуйста продаваемые Вами товары Вы
покупаете в РФ у посредников? Если да - я готова
предложить Вам закупать их напрямую у производителей.

Я обеспечу:
- Подбор груза на фабрике-изготовителе в любой точке мира;
- Транзит до промежуточного склада в Европе
(Германия, Прибалтика);
- Таможенное оформление и сопровождение груза на
всех этапах его перевозки;
- Предоставление документации (договор, накладная, счет-фактура);
- Доставка товара на Ваш склад.

Сообщите пожалуйста какой товар Вам мог бы быт
интересен - я рассчитаю стоимость с учетом всех
расходов, предложу различные варианты по производителям.

С уважением, Светлана.
__ - unicorn-public <at>
please quote as little as necessary when replying
Mail Delivery System | 12 May 11:17 2014

Mail delivery failed: returning message to sender

This message was created automatically by mail delivery software.

A message that you sent could not be delivered to one or more of its
recipients. This is a permanent error. The following address(es) failed:

  ujjal.chakroborty <at>
    Unrouteable address

__ - unicorn-public <at>
please quote as little as necessary when replying

Eric Wong | 8 May 10:43 2014

subscription to new ML probably working...

I'll migrate everybody else over around 20140514T20:00Z, otherwise you
might get duplicate messages from being subscribed to both lists.
If you're willing to deal with dupes for a few days, you can try
subscribe/unsubscribe/help commands:

	unicorn-public+subscribe <at>
	unicorn-public+unsubscribe <at>
	unicorn-public+help <at>
	(help will tell you the rest)

Stop reading here unless you're interested in implementation details :>

I only have mlmmj configured to handle the +commands, outgoing SMTP,
and bounces.  It does not receive normal list traffic like a standard
mlmmj install.  Instead, I have it configured to replay data from ssoma
every minute, so I used (as the mlmmj user):

    ssoma add $NAME $URL "command:ssoma-replay -L $HOME/spool/$NAME"

Where ssoma-replay is a tiny shell script which reads from stdin:
MSG=$(mktemp -t ssoma-replay.orig.$USER.XXXXXX || exit 1)
cat > "$MSG"
exec /usr/bin/mlmmj-send "$ <at> " -m "$MSG"
This means it should be easy to have outgoing SMTP on a different server
and allow other folks to run the same service.
(Continue reading)

Eric Wong | 7 May 10:05 2014

[ANN] unicorn 4.8.3 - the end of an era


This release updates documentation to reflect the migration of the
mailing list to a new public-inbox[1] instance.  This is necessary
due to the impending RubyForge shutdown on May 15, 2014.

The public-inbox address is: unicorn-public <at>
    (no subscription required, plain text only)
ssoma[2] git archives: git://
browser-friendly archives:

Using, getting help for, and contributing to unicorn will never
require any of the following:

1) non-Free software (including SaaS)
2) registration or sign-in of any kind
3) a real identity (we accept mail from Mixmaster)
4) a graphical user interface

Nowadays, plain-text email is the only ubiquitous platform which
meets all our requirements for communication.

There is also one small bugfix to handle premature grandparent death
upon initial startup.  Most users are unaffected.

[1] policy: - git://
    an "archives first" approach to mailing lists
[2] mechanism: - git://
    some sort of mail archiver (using git)

(Continue reading)


Реклама, с оплатой только за обращения


Наше агентство занимается рекламой в интернете, с
оплатой за звонки.

Наши преимущества:
- Вы платите только за обращения, длившиеся не менее 30 сек.
- Подробный отчет по совершенным звонкам и списаниям
средств доступен в личном кабинете.

Схема работы с нами:
- Вы пополняете баланс в личном кабинете.
- Мы рекламируем Ваше рекламное объявление.
- При поступлении звонков - с Вашего баланса
списываются деньги за каждый поступивший звонок.

Стоимость одного звонка составляет от 300 до 500 руб. (в
зависимости от сферы Вашего бизнеса).

Обращайтесь по любым вопросам по телефону: [ 49 5]   545  1Ч 92 

__ - unicorn-public <at>
please quote as little as necessary when replying
Eric Wong | 3 May 01:15 2014

[RFC/PATCH] http_server: handle premature grandparent death

When daemonizing, it is possible for the grandparent to be
terminated by another process before the master can notify
it.  Do not abort the master in this case.

This may fix the following issue:

(which I was notified of privately via email)
 Will push and tag 4.8.3 this weekend (along with mailing list change).

 lib/unicorn/http_server.rb | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lib/unicorn/http_server.rb b/lib/unicorn/http_server.rb
index 21cb9a1..a0ca302 100644
--- a/lib/unicorn/http_server.rb
+++ b/lib/unicorn/http_server.rb
 <at>  <at>  -272,7 +272,11  <at>  <at>  def join
     proc_name 'master' "master process ready" # test_exec.rb relies on this message
     if  <at> ready_pipe
-       <at> ready_pipe.syswrite($$.to_s)
+      begin
+         <at> ready_pipe.syswrite($$.to_s)
+      rescue => e
+        logger.warn("grandparent died too soon?: #{e.message} (#{e.class})")
+      end
        <at> ready_pipe =  <at> ready_pipe.close rescue nil
(Continue reading)

Bráulio Bhavamitra | 30 Apr 15:54 2014

Does unicorn waits after_work to consider a worker ready?

Hello all,

I had to use `sleep` (see
to make rolling restart on my unicorn configuration.

But I'm worried if unicorn consider the worker ready for request even
before after_fork finishes. Could you say if that is true?



"Lute pela sua ideologia. Seja um com sua ideologia. Viva pela sua
ideologia. Morra por sua ideologia" P.R. Sarkar

EITA - Educação, Informação e Tecnologias para Autogestão

"Paramapurusha é meu pai e Parama Prakriti é minha mãe. O universo é
meu lar e todos nós somos cidadãos deste cosmo. Este universo é a
imaginação da Mente Macrocósmica, e todas as entidades estão sendo
criadas, preservadas e destruídas nas fases de extroversão e
introversão do fluxo imaginativo cósmico. No âmbito pessoal, quando
uma pessoa imagina algo em sua mente, naquele momento, essa pessoa é a
única proprietária daquilo que ela imagina, e ninguém mais. Quando um
ser humano criado mentalmente caminha por um milharal também
imaginado, a pessoa imaginada não é a propriedade desse milharal, pois
ele pertence ao indivíduo que o está imaginando. Este universo foi
criado na imaginação de Brahma, a Entidade Suprema, por isso a
(Continue reading)