Created
June 26, 2013 22:18
-
-
Save dsuch/5872245 to your computer and use it in GitHub Desktop.
HAProxy config for URL-based rate limiting
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# At most 10 concurrent connections from a client | |
acl too_fast fe_sess_rate ge 10 | |
# Matches any path beginning with a given prefix | |
acl bursts_inclined path_beg -i /client1 | |
# Effectively working as a delay mechanism for clients that are too fast | |
tcp-request inspect-delay 1000ms | |
# Fast-path - accept connection if it's not this troublesome client | |
tcp-request content accept unless bursts_inclined too_fast | |
# The very fast client gets here meaning they have to wait full inspect-delay | |
tcp-request content accept if WAIT_END |
Hi @isaacegglestone,
apologies but I haven't spotted your question before.
It's for HAProxy 1.5 and later.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What version is this good for?