# Route to the same instance for the same client

**URL:** <https://discourse.haproxy.org/t/route-to-the-same-instance-for-the-same-client/1714>\
**Category:** Help!\
**Created:** [October 27, 2017, 11:19am UTC](https://discourse.haproxy.org/t/route-to-the-same-instance-for-the-same-client/1714 "2017-10-27T11:19:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ngocketit](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.haproxy.org/ngocketit/32/318_2.png) [@ngocketit](https://discourse.haproxy.org/u/ngocketit)\
**Post date:** [October 27, 2017, 11:19am UTC](https://discourse.haproxy.org/t/route-to-the-same-instance-for-the-same-client/1714/1 "2017-10-27T11:19:14Z")

</div>

Hi,

I’m planning to use HAProxy for TCP (not HTTP/HTTPS) traffic load balancing. Does HAProxy support routing to the same instance for the same client? For example, if client A is routed to instance B for the first time and disconnects. Next time, it tries to connect again, how to ensure that A is routed to B?

---

<div class="post-metadata">

**Author:** ![lukastribus](https://avatars.discourse-cdn.com/v4/letter/l/7ea924/32.png) [@lukastribus](https://discourse.haproxy.org/u/lukastribus)\
**Post date:** [October 27, 2017, 12:57pm UTC](https://discourse.haproxy.org/t/route-to-the-same-instance-for-the-same-client/1714/2 "2017-10-27T12:57:04Z")

</div>

There are a lot of options to ensure subsequent session go to the same backend server.

source IP hashing, cookies, session ID stickiness are features that haproxy can use to make this happen for example.

Also see:

> **[Load Balancing, Affinity, Persistence, Sticky Sessions: What You Need to Know...](https://www.haproxy.com/blog/load-balancing-affinity-persistence-sticky-sessions-what-you-need-to-know/)**
>
> Synopsis To ensure high availability and performance of Web applications, it is now common to use a load-balancer. While some people uses layer 4 load-balancers, it can be sometime recommended to use layer 7 load-balancers to be more efficient with...
