<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:lighttpd.net:lighttpd2/doc1">
	<short>balances between different backends.</short>

	<description><markdown>
		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.
	</markdown></description>

	<action name="balance.rr">
		<short>balance between actions (list or single action) with Round-Robin</short>
		<parameter name="actions">
			<short>the actions to balance between</short>
		</parameter>
		<description><markdown>
			Round-Robin (rr) the requests are distributed equally over all backends.
		</markdown></description>
		<example>
			<config>
				balance.rr { fastcgi "127.0.0.1:9090"; };
			</config>
		</example>
		<example>
			<config>
				balance.rr ({ fastcgi "127.0.0.1:9090"; }, { fastcgi "127.0.0.1:9091"; });
			</config>
		</example>
	</action>

	<action name="balance.sqf">
		<short>balance between actions (list or single action) with SQF</short>
		<parameter name="actions">
			<short>the actions to balance between</short>
		</parameter>
		<description><markdown>
			Shortest-Queue-First (sqf) is similar to Round-Robin and prefers the backend with the shortest wait-queue.
		</markdown></description>
		<example>
			<config>
				balance.sqf { fastcgi "127.0.0.1:9090"; };
			</config>
		</example>
	</action>

	<option name="balance.debug">
		<short>enable debug output</short>
		<default><value>false</value></default>
	</option>

</module>
