Report this

What is the reason for this report?

Does websocket handshake works out of the box with horizontal scaling?

Posted on September 16, 2022

I am in the process of starting a new project with a Node.js app hosted on App Platform for which I will need horizontal scaling.

This app will, among other things, use websockets to communicate with the frontend part.

I saw this post in which the answer state that a correlation strategy must be setup for the websocket communication to work in a multi-instances environment.

Is it still the case? And is there anything particular to do regarding the handshake phase of the connection?

Thanks,



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

👋 @tbordiga

Yes, apps that use websockets will need some sort of correlation strategy if the app is using horizontal scaling.

With websockets once the connection is made you will continue to be directed to the same instance of the app until that connection is broken. So handshakes between instances for established connection isn’t necessary, however, each instance will (likely) need to maintain a list of clients connected to it and use something (eg. pub/sub) to dispatch messages that all of the instances can read and then direct to the appropriate client.s

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

Dark mode is coming soon.