On 14 Dec 2004, at 15:38, Anthony R. J. Ball wrote:
I do this by just forking 2 x NumCPUs children off in my code at work. That's the most stable way to do things. Perl's ithreads is still a rather undiscovered territory :-)
It's also easy, and in a loaded system will most likely balance about as well as any other method.
Curious though, why two per instead of just one per.
Because you always end up doing *some* blocking things (i.e. any time you're in perl functions or other system calls), so this gives the other process chance to do something useful.
I have yet to try upping the 2x number to something higher - there's probably a good balance somewhere to be struck between adding extra processes (thus more processes to wake up when a new connection comes in) and keeping them low to reduce contention.
Matt.
