# Least-stick-table-entries balance algorithm

**URL:** <https://discourse.haproxy.org/t/least-stick-table-entries-balance-algorithm/2610>\
**Category:** Help!\
**Created:** [June 13, 2018, 6:32am UTC](https://discourse.haproxy.org/t/least-stick-table-entries-balance-algorithm/2610 "2018-06-13T06:32:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![user5396668](https://avatars.discourse-cdn.com/v4/letter/u/6bbea6/32.png) [@user5396668](https://discourse.haproxy.org/u/user5396668)\
**Post date:** [June 13, 2018, 6:32am UTC](https://discourse.haproxy.org/t/least-stick-table-entries-balance-algorithm/2610/1 "2018-06-13T06:32:32Z")

</div>

Hi all,

I am planning a system with client and server microservices and haproxy as a load balancer between them.  
In my system I need to have stickiness on the HTTP request ‘path’ and I want to have an equal distribution of such stickiness to the servers in the backend.  
For high availability I plan to have few haproxy instances configured as peers and synch-ed on the stick-table.

Is it possible with haproxy to have a stick-table and a _balance_ algorithm as:  
_if there is a match in the stick-table – take it, otherwise, select the server with the **lowest number of entries in the stick-table**._  
It is something similar to the ‘leastconn’ algorithm, just instead of referencing open connections it should reference the number of already assigned paths.

Thanks!

---

<div class="post-metadata">

**Author:** ![Baptiste](https://avatars.discourse-cdn.com/v4/letter/b/cab0a1/32.png) [@Baptiste](https://discourse.haproxy.org/u/Baptiste)\
**Post date:** [June 21, 2018, 10:36pm UTC](https://discourse.haproxy.org/t/least-stick-table-entries-balance-algorithm/2610/2 "2018-06-21T22:36:22Z")

</div>

Hi,

this is unfortunately not doable at that time.

---

<div class="post-metadata">

**Author:** ![user5396668](https://avatars.discourse-cdn.com/v4/letter/u/6bbea6/32.png) [@user5396668](https://discourse.haproxy.org/u/user5396668)\
**Post date:** [June 25, 2018, 5:43am UTC](https://discourse.haproxy.org/t/least-stick-table-entries-balance-algorithm/2610/3 "2018-06-25T05:43:53Z")

</div>

Got it.  
Thanks for responding!
