Kernel.srand after_fork

ghazel at gmail.com ghazel at gmail.com
Fri Jan 28 04:57:33 EST 2011


Hi,

We recently noticed random numbers from the Unicorn workers were
turning up lots of duplicates across requests. Is it possible that the
random seed generated when the ruby interpreter starts is duplicated
when the workers are forked, and not re-seeded after fork?

If so, should I call Kernel.srand in after_fork, or is this something
which should be added to Unicorn?

-Greg


More information about the mongrel-unicorn mailing list