Load balance session to same server

websss
websss used Ask the Experts™
on
I have a scenario where I need a load balancer
When a new tcp connection is initiated from the client, the load balancer much assign a server, and always route all traffic from that that to the server it initially picked

When I netstat, I see and ipaddress and port for the client. (connection) so it makes sense to use this as the identifier for that client

Is there any software in exisitance to do this? Or do. I need to write my own?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Software Engineer
Distinguished Expert 2018
Commented:
Session affinity/persistence/stickyness  can be done in various ways depending on data to be transported.
haproxy should be able to do this for you.
See below article. (Load balancing + getting the the same backend is not limited to HTTP though, you can do more (even encrypted SSL traffic)  as there almost always is some kind of key-id/ session-id inside packets.

https://www.haproxy.com/blog/load-balancing-affinity-persistence-sticky-sessions-what-you-need-to-know/

Commented:
If you're using Windows server, just install the feature Network Load Balancer.

It's free and you can add as many additional servers in there (you'll need to install NLB on each server you want to be part of the load balance)

You can allow specific ports (80,443) to load balance.  You can set it up to go to a specific server or load balance to the best server available and so on.

Here's a walkthrough on how to get it installed and configured:

https://wiki.unify.com/wiki/How_to_configure_NLB_for_Windows_Server
nociSoftware Engineer
Distinguished Expert 2018

Commented:
@coolie: Topics are: "Linux networking"...    
haproxy is free & opensource.  and gratis as well.  without any requirement for Clustering or transforming your LAN into a broadcast network wrt. to NLB systems.  Or even a windows server license...
(effectively there are quite a few "hardware" loadbalancer's which actually run haproxy.)

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial