How is everyone handling parallelization for their webserver processes?
Is anyone already using pm2 or meteor-cluster? How well do they work?
I can see benefits to both tools, so I’m having a hard time deciding. Our current environment is already load balanced the old fashioned way but we’re still using Forever for our process management. PM2 feels like a nice upgrade that gets us clustering for free, but I’m not sure how well it works.
I think you are referring to multi-core support right?
PM2 uses NodeJS cluster module for clustering. Which is not work for sticky sessions and hence with Meteor. meteorhacks:cluster uses a different approach and it does sticky session support and works pretty much well with Meteor.
And Node’s 0.10.x cluster does not equally distribute the load. But meteor cluster do.
(both uses some low level socket sharing API in node)
@Sparser did you see the meteorhacks:cluster docs where you can specify probabilities that the node will accept the request? Are they all non-zero and close to one? Did you solve why it seems to be processing on a single core? If so, what was the issue?
I didn’t actually see that but I will go review. I left the cluster
settings at default since I didn’t see any reason to go beyond the normal
use case.
I haven’t “solved” the issue as of yet, I’m currently trying to use Kadira
as a tool to help me identify bottlenecks. I’m currently reworking some of
my subscriptions to drastically reduce the data they send over.
yes; also use the fields specifier left and right in your queries to
limit unnecessary data being sent.
to your first comment: I see, well I’m sure specifying that information
will help you. You could delegate a processor to route requests or carry
out serving based on a probabilistic weighting factor. I’m looking forward
to playing with that package myself.