james at lovedthanlost.net
Sun Nov 15 19:08:56 EST 2009
-----BEGIN PGP SIGNED MESSAGE-----
Eric Wong wrote:
> This is expected. The kernel wakes up all the workers when there's
> _one_ connection and they all race to accept() one client connection.
> One wins and accepts the connection, 3 lose and go back to sleep. With
> lots of worker processes, this can be a thundering herd problem but
> that's why we encourage Unicorn as a backend server, not as a frontend
Ah okay - makes sense.
> Do you by any chance do user switching in your application
> or config.ru?
In the application we do.
> Instead, since 0.94.0, I would do this:
> after_fork do |server, worker|
> worker.user('user', 'group') if Process.euid == 0
> That way only the worker process drops permissions. The master really
> doesn't do anything interesting. Of course *I* would just start
> Unicorn as a regular user and forget the complexity of user switching
Okay thanks - will give that a shot.
* Pro Linux System Administration (http://tinyurl.com/linuxadmin)
* Pulling Strings with Puppet (http://tinyurl.com/pupbook)
* Pro Nagios 2.0 (http://tinyurl.com/pronagios)
* Hardening Linux (http://tinyurl.com/hardeninglinux)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
-----END PGP SIGNATURE-----
More information about the mongrel-unicorn