![]() |
Some articles about HAProxy and LuaI try to reference some articles form many sources talking about Lua in haproxy. I select only articles exposing Lua use cases. My main goal is to provide a library of concrete case for making easy the usage of Lua in HAProxy. Adding random delay for specific HTTP Requests with HAProxy + Lua http://godevops.net/2015/06/24/adding-random-delay-specific-http-requests-haproxy-lua/
Lately, i wanted to delay specific http requests and i wanted to have a
random delay for every of these requests (for example in a range from 1000ms
to 2000ms). One possible use case was to absorb and slow down traffic bursts
that came from bots/crawlers/spiders or abusers (bad behavior clients in
general)...
HAProxy load balancing with sticky sessions based on request body
https://touk.pl/blog/2016/03/22/haproxy-sticky-sessions-for-soap-payloads/
Integrating systems you have no influence on needs a lot of workarounds.
Recently we could not scale Python service consuming SOAP messages with a new
hardware. It just didn't benefit from more processing cores. On the other
hand (and this happens often with older software) setting up several
instances gave almost linear scalability. Only thing left - configure a
loadbalancer and we are done...
Selecting a HAProxy backend using Lua
http://www.dx13.co.uk/articles/2016/5/27/selecting-a-haproxy-backend-using-lua.html
Once you've learned the basics of using Lua in HAProxy, you start to see
a lot of places the scripting language could be useful. At Cloudant, one
of the places we saw that we could make use of Lua was when selecting
from the various backends to which our frontend load balancers direct
traffic. We wrote a simple proof of concept, which I wanted to document
here along with some of the problems we hit along the way...
ACME domain validation plugin
https://github.com/janeczku/haproxy-acme-validation-plugin
HAProxy plugin implementing zero-downtime ACME http-01 validation for
domains served by HAProxy instances. The plugin leverages HAProxy's Lua
API to allow HAProxy to answer validation challenges using
token/key-auth files provisioned by an ACME client to a designated
directory.
Dynamic config with LUA
https://sites.google.com/site/mytechnicalcollection/cloud-computing/load-balancing/haproxy/dynamic-config
This article shows a way for configuring HAProxy dynamically using Lua.
Suggested echo server implementation with HAProxy and Lua
https://forums.informaction.com/viewtopic.php?f=8&t=21390
This article gives an example of echo server. This server is benchmarked.
he results are quite interesting, but I advise against using HAProxy + Lua
as Apache + PHP replacement.
haproxy-lua-examples
https://github.com/zareenc/haproxy-lua-examples
This GIT repository contains some sample scripts and configs for
HAProxy with Lua.
|