Strange Thread related errors

Jeremy Evans jeremyevans0 at gmail.com
Thu Jan 7 13:10:02 EST 2010


On Thu, Jan 7, 2010 at 8:31 AM, Iñaki Baz Castillo <ibc at aliax.net> wrote:
> Don't set the Sequel instance in the master process, instead do it in each
> worker ("after_fork" block in unicorn config file).

Alternatively, you can set up the Sequel Database in the master
process, and just call Database#disconnect before forking.

> In this way each process has its own Sequel instance with its own threads
> pool.
>
> Also, using Sequel thread pool makes no sense when using Unicorn as each
> worker is single thread, so I gain some performance by setting
> "single_threaded = true" in Sequel database configuration (no thread pool
> stuff).

This is good advice.

Jeremy


More information about the mongrel-unicorn mailing list