1

I am trying to use both cpus on openshift gears with node.js, but i have no idea on how to proceed with cluster module as the port is a openshift variable. Do i assign arbitrary values for the ports or use the same variable for the cluster

1 Answer 1

1

OpenShift will only give you access to one core per application instance (per "gear").

If you want to cluster Nodejs on OpenShift, I'd recommend using OpenShift's HAProxy tooling to scale up and down.

I wrote up a few notes on this topic here: https://www.openshift.com/blogs/10-reasons-openshift-is-the-best-place-to-host-your-nodejs-app#scale

Sign up to request clarification or add additional context in comments.

2 Comments

cpus().length returns 2, so i guess i can spawn two processes
You can spawn additional processes, but OpenShift's loadbalancer won't hand out additional port+IP pairs for that process to bind to. The lb won't be directing any traffic to this additional process.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.