umicat is a L4 reverse proxy load balance server. umicat can provide load balancing service for TCP/UDP network services in the form of reverse proxy.
make
sudo make install
max_fails
: passive health check max fails, if the number of fails exceeds this value, the server will be considered as down.fail_timeout
: passive health check fail timeout. If the server is down, after this time, the server will be tried again.is_fallback
: If the server is down, whether to fallback to the next server.
type
: health check type.port
: Health check port.interval
: Health check interval.timeout
: Health check timeout.fall
: The number of consecutive failures to consider a server as down.rise
: The number of consecutive successes to consider a server as up.
round_robin
: Round-robin load balance policy.weight
: Weight of the server.
random
: Random load balance policy.weight
: Weight of the server.
ip_hash
: IP-hash load balance policy.weight
: Weight of the server.
least_conn
: Least-connection load balance policy.heuristic
: Heuristic traffic load balance policy.traffic_window
: Traffic window size. (seconds)
Please configure /etc/umicat/umicat.conf
before you start using it:
{
"mode": "tcp",
"localport": 10201,
"policy": "round_robin",
"upstream": [
{
"upstream_ip": "127.0.0.1",
"upstream_port": 9832,
"weight": 10,
"traffic_window": 30,
"max_fails": 2,
"fail_timeout": 10,
"is_fallback": 1,
"check": {
"type": "tcp",
"port": 9832,
"interval": 5,
"timeout": 5,
"fall": 3,
"rise": 2
}
},
{
"upstream_ip": "127.0.0.1",
"upstream_port": 9999,
"weight": 10,
"traffic_window": 30,
"max_fails": 2,
"fail_timeout": 10,
"is_fallback": 1,
"check": {
"type": "tcp",
"port": 9999,
"interval": 15,
"timeout": 5,
"fall": 3,
"rise": 2
}
}
],
"workers": "auto",
"log_level": "info",
"log_file": "/var/log/umicat/umicat.log"
}
Then, you can enjoy it:
sudo umicat -c /etc/umicat/umicat.conf -l /var/log/umicat/umicat.log
docker run -P -it --rm sunbk201/umicat