actionheroCluster: philosophy and practice?

35 views
Skip to first unread message

Ramsay Brown

unread,
Sep 23, 2014, 1:26:48 AM9/23/14
to action...@googlegroups.com
Hello!

I might be suffering from a philosophical or technical (or both!) misunderstanding of the Actionhero cluster - can you please help?

Would one use an actionhero cluster when they were looking to increase the performance (in terms of some metric like calls / second) of their single actionhero server via load balancing AND they had computational resources to spare? (This is how I understand the 'why' of the cluster - but I could be wrong!)

Are there any special technical needs for the cluster? Or can any actionhero server be turned into the cluster by starting it with startCluster command and the appropriate workers flag? (I've tried this and I'm getting no calls/sec performance increases according to Apache jMeter...)

Evan Tahler

unread,
Sep 23, 2014, 1:46:56 AM9/23/14
to Ramsay Brown, action...@googlegroups.com
If you can run single-node actionhero (actionhero start) there are no additional requirements to run actionhero-cluster (actionhero startCluster).  However, you are *required* to use a real redis server at the very least to enable communication across the nodes.  node is single-threaded, which means it can only use 1 CPU at a time.  If you have the spare memory and idle CPUs, you probably want to run more than one instance of actionhero, so you should check out the cluster.  I say "probably" because it depends on where your app is constrained.  For example if node is not the limiting factor, but your database (mysql, mongo, redis, etc) is the bottleneck, then adding more node/actionhero servers might make things worse.  If you are serving a lot of static content and disk i/o is your limiting factor, than cluster will have no effect at all.  However, if your application is CPU or Network bound, than cluster is certainly for you! 

My deployments have both a load balancer and cluster so I have lb -> servers -> ah-clusters -> ah-workers.  High Availability! I also end up using redis sentinel most of the time as well so redis isn't a single-point-of-failure either. 

Cluster does help in some other ways. You can add/remove workers on the fly, you can do o-downtime deployments, and some other things. It also restarts workers that crash.  Even when I only have one worker, I still use the cluster to manage deployments.

Looks like GitTips is now GratiPay... this is me :D https://gratipay.com/evantahler/

--
You received this message because you are subscribed to the Google Groups "actionHero.js" group.
To unsubscribe from this group and stop receiving emails from it, send an email to actionhero-j...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages