Question

Load balancing with same source port, but different target ports

Hi,

I want to explore the option to use DigitalOcean’s load balancer to balance between different node instances on the same droplet (listening on different ports) - in order to utilize all the cores in a droplet. I guess it’s possible to do this with something like nginx, but I want to offload the processing to the load balancer.

Here’s a screenshot illustrating the issue: https://pasteboard.co/GFT6jyU.png

It’s not possible to set the same source port (https - 443) but different target ports in DigitalOcean’s load balancer configuration.

Anyone knows if this is a known limitation? Or maybe there are plans to support it in the future? Or maybe some other idea?

Cheers D.

Subscribe
Share

Submit an 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.

Accepted Answer

The DO load balancers are meant to distribute traffic across multiple droplets, not one droplet and multiple ports.

I would use a Ubuntu:16.04 droplet with NGINX or HAProxy as your reverse proxy/loadbalancer and LXC/LXD or Docker within a single instance.

Keep in mind your performance is limited by the droplet size.

I see. I would think that it would be possible.

If not with the DO loadbalancers, then with HAProxy or NGINX running in a separate instance or perhaps the smallest droplet.

True, but it’s also limited by Node.js’ JavaScript engine to utilize one core. I understand what DO’s load balancers are meant for, but I guess my question is - is there any reason not to allow this? I mean, this could actually be useful - removing the need for a reverse proxy per machine in could potentially provide a nice performance boost.