On 12/30/2013 03:04 AM, Stefan Adams wrote:
On Mon, Apr 1, 2013 at 6:09 PM, Sebastian Riedel <[email protected]>wrote:
To scale with blocking backend APIs you have to increase the number of
worker processes and reduce the number of concurrent connections each
worker is allowed to handle.
Mojo::Server::Prefork::workers() states "Number of worker processes,
defaults to 4. *A good rule of thumb is two worker processes per CPU core.*"
Why is the good rule of thumb linked to the number of CPU cores? If your
app blocks but you expect or wish to be able to handle a few dozen
concurrent connections, wouldn't you need a few dozen workers?
On my machine with 4 core, -w 8 -c 1 is insufficient to handle 30
concurrent connections but -w 30 -c 1 handles it well.
Is sri's advice documented anywhere in the Mojo docs? Would it be prudent
to do so -- to indicate better tuning advice for use with blocking backend
APIs?
It's not mentioned as such, I think, but then again the things you do to
scale up one app don't necessarily work on another - and I do think that
it's better to not have it explicitly mentioned in the documentation
either; scaling is pretty advanced stuff and requires not only tuning
the app, but tuning everything related to it, so you're involving
multiple people (well, unless you're a one man show but that aside) and
there are always exceptions to any rule.
However you could always write a little something about how you scaled
your app, maybe presentation style, or in a nice blog post, so that
people with similar apps or similar issues can learn from it?
Just sort of rambling here :)
--
You received this message because you are subscribed to the Google Groups
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/groups/opt_out.