# Stick tables, more tables or a better option

**URL:** <https://discourse.haproxy.org/t/stick-tables-more-tables-or-a-better-option/5868>\
**Category:** Help!\
**Created:** [October 29, 2020, 11:22pm UTC](https://discourse.haproxy.org/t/stick-tables-more-tables-or-a-better-option/5868 "2020-10-29T23:22:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![STOIE](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.haproxy.org/stoie/32/1289_2.png) [@STOIE](https://discourse.haproxy.org/u/STOIE)\
**Post date:** [October 29, 2020, 11:22pm UTC](https://discourse.haproxy.org/t/stick-tables-more-tables-or-a-better-option/5868/1 "2020-10-29T23:22:33Z")

</div>

Hi all,

I have a bit of an issue, is there a way to have a bigger stick table (longer expiry) and then deny based on matches in a specific time window… rather than me needing multiple tables for 1 minute, 5 minute, 1 hour time windows etc.

Else, if there isn’t and more stick tables is the solution, are there any packages available that allow a larger number of stick tables so that I don’t have to maintain a custom build from source?

Any help would be awesome,

Cheers,

---

<div class="post-metadata">

**Author:** ![STOIE](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.haproxy.org/stoie/32/1289_2.png) [@STOIE](https://discourse.haproxy.org/u/STOIE)\
**Post date:** [October 30, 2020, 12:00am UTC](https://discourse.haproxy.org/t/stick-tables-more-tables-or-a-better-option/5868/2 "2020-10-30T00:00:04Z")

</div>

I feel like I’m just the lazy idiot and haven’t read enough yet, seems the way I’m using stick tables is outdated and can probably be optimised… might start there first.

If anyone can provide some info regarding to some pretty advanced rate-limited solutions and examples of stick tables being used in action, I’d be super keen to see them.

---

<div class="post-metadata">

**Author:** ![STOIE](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.haproxy.org/stoie/32/1289_2.png) [@STOIE](https://discourse.haproxy.org/u/STOIE)\
**Post date:** [November 2, 2020, 4:33am UTC](https://discourse.haproxy.org/t/stick-tables-more-tables-or-a-better-option/5868/3 "2020-11-02T04:33:44Z")

</div>

Seems that while I’ve learnt a-lot I’m still back to banging my head on this one…

Is there a way to have multiple time period limits but driven from a single stick-table?

Ie. rather than using the expiry of the table, use a lookup from the table data based on entries that fall within (cur\_time-60seconds)-\>cur\_time…

---

<div class="post-metadata">

**Author:** ![STOIE](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.haproxy.org/stoie/32/1289_2.png) [@STOIE](https://discourse.haproxy.org/u/STOIE)\
**Post date:** [January 8, 2021, 12:02am UTC](https://discourse.haproxy.org/t/stick-tables-more-tables-or-a-better-option/5868/4 "2021-01-08T00:02:06Z")

</div>

Hi all,

I guess I want to bump this one again… since I haven’t got anywhere.

My simple question would be, is there a way to use the same stick-table twice for basic time-based rate-limiting?

Eg. have a stick-table that lasts for 24 hrs, but then query multiple time periods against it, somewhat like: if number of request by IP in the last 1 minute \> 10… kick AND if number of request by IP in the last 10 hours \> 1000 kick…  
BUT, using the same stick-table (rather than needing two separate 1min and 10 hour tables).
