Skip to content

The server chosen by balancer is NOT the "best" #2030

@robot-dot-win

Description

@robot-dot-win

I have a local transparent proxy with the balancer:

{
    "locals": [
        {
            "local_address": "127.0.0.1",
            "local_port": 61082,
            "protocol": "redir",
            "tcp_redir": "redirect"
        }
    ],

    "servers": [
        // The domestic server(local host):
        {
            "address": "127.0.0.1",
            "port": 51080,
            "method": "none",
            "tcp_weight": 1.0
        }

        // The overseas server:
        {
            "address": "65.x.x.x",
            "port": xxxx,
            "method": "aes-256-gcm",
            "password": "password_string",
            "tcp_weight": 0.6
        },
    ],

    "balancer": {
        "max_server_rtt": 3,
        "check_interval": 120,
        "check_best_interval": 5
    },

    "mode": "tcp_only",
    "no_delay": false,
    "fast_open": true
}

I hope most traffic will be via the domestic server, and the overseas server will act as a backup. At the beginning the chosen server is domestic, but after a while the overseas server will be chosen and from then on it seems that the balancer will always think the overseas server as the best. See log please:

Image What did it happen and how to config? Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions