mod_balance

mod_balance balances between different backends.

Using an action from mod_balance also activates a backlog: lighttpd2 will then put requests in a backlog if no backend is available and try again later.

Be careful: the referenced actions may get executed more than once (until one is successful!), so don’t loop rewrites in them or something similar.

balance.rr (action)

balance between actions (list or single action) with Round-Robin

balance.rr actions;
actions
the actions to balance between

Round-Robin (rr) the requests are distributed equally over all backends.

Example

balance.rr { fastcgi "127.0.0.1:9090"; };

Example

balance.rr ({ fastcgi "127.0.0.1:9090"; }, { fastcgi "127.0.0.1:9091"; });

balance.sqf (action)

balance between actions (list or single action) with SQF

balance.sqf actions;
actions
the actions to balance between

Shortest-Queue-First (sqf) is similar to Round-Robin and prefers the backend with the shortest wait-queue.

Example

balance.sqf { fastcgi "127.0.0.1:9090"; };

balance.debug (option)

enable debug output

balance.debug value;
Default value: false