Advanced 8 min read
Clash Proxy Groups: url-test vs. fallback vs. load-balance
Compare how Clash’s url-test, fallback, and load-balance groups check nodes, switch connections, and fit different use cases. Includes mihomo interval, tolerance, and strategy settings.
Lowest-latency selection, primary/backup failover, and connection distribution
Rules determine which proxy group handles a connection; the group then selects a member to route it through. To automatically choose a low-latency node, use url-test. For a fixed primary with a backup used only when it fails, use fallback. To distribute separate connections across multiple routes, use load-balance. This guide covers the mihomo (Clash Meta) core; group names may differ in your client’s UI.
| Type | Selection criteria | Best for |
|---|---|---|
url-test | Compares latency to a test URL for available members and accounts for switching tolerance | Several similar routes whose latency varies, when you want the lowest-latency outbound selected automatically |
fallback | Selects the first available member in the configured order | A fixed primary route with backups enabled in order if the primary fails |
load-balance | Selects an available member according to the distribution strategy | Distributing different destinations or independent connections across multiple outbounds |
Here, a “latency check” is closer to an HTTP probe than a download speed test. A node reaching the test URL does not guarantee it can reach your target site. Switching outbounds mainly affects new connections; existing downloads, calls, and long-lived connections do not move to another route.
url-test: Use tolerance to avoid switches for minor latency changes
url-test probes the same URL through each member and compares the results. tolerance is measured in milliseconds; it lets the current available node stay selected when it is only slightly slower. It is neither a timeout limit nor a value subtracted from every latency reading.
- Within tolerance: Suppose the current node is at 128 ms and another is at 105 ms, with tolerance set to 50 ms. The 23 ms difference is within tolerance, so the current node can remain in use.
- Beyond tolerance: Suppose the current node rises to 190 ms while another is at 105 ms. The 85 ms difference exceeds tolerance, so new connections can use the lower-latency node.
- Current node unavailable: Switching tolerance is no reason to keep an unavailable node selected. If other healthy members are available, the group can choose one of them.
50 ms is a reasonable starting point, not a rule. On a home network, if candidate nodes often differ by only a few tens of milliseconds, observe several checks before adjusting tolerance. If a particular site keeps failing to load, first compare how it performs through each node instead of lowering tolerance from 50 ms to 10 ms based on probe results alone.
fallback: Set primary and backup routes by member order
Put the primary route first in the proxies list, followed by backups in the order they should be used. Suppose the primary checks at 160 ms and a backup at 90 ms: new connections still prefer the primary as long as it is considered available. fallback does not reorder members by latency, and setting a latency tolerance does not turn it into url-test.
Once the primary is considered unavailable, new connections switch to the next available route. When the primary becomes available again, subsequent connections prefer it. This does not mean failed requests are automatically retried, nor does it guarantee an immediate switch after a failure. The observed failover time depends on the check interval, probe timeout, and when health status is updated.
load-balance: Choose between destination-based and round-robin distribution
load-balance health checks filter the available members; they do not assign node weights based on latency. strategy determines how an outbound is selected. Start with either of these options:
consistent-hashing: Uses consistent hashing by destination. While the set of available members remains stable, the same hash key tends to use the same node—useful when you want to minimize outbound changes for a given destination. A website may use several unrelated domains, and nodes joining or leaving can change the mapping, so this does not guarantee one outbound for an entire login session.round-robin: Assigns new connections to available members in turn, which suits independent tasks that can use different outbounds. It does not split a single TCP connection across multiple nodes or ensure that each node transfers the same number of bytes.
When testing round-robin, do not just refresh one browser tab repeatedly. The browser may reuse the same HTTP/2 connection, so multiple refreshes may not trigger multiple outbound selections. Test with separate new connections, then check which nodes they actually use in the connection list. For login or payment services sensitive to outbound IP changes, use a dedicated rule to pin traffic to a fixed outbound.
mihomo Configuration Example: interval, tolerance, and strategy
This example assumes the active configuration already has three entries in proxies named “Node A,” “Node B,” and “Node C.” Replace the member names with the ones in your configuration. If it already has proxy-groups, merge in only the three list items below—do not add a second top-level key with the same name. After creating the groups, reference the desired group in your existing routing rules or add it to an existing manual selection group. Creating a proxy group alone does not change how traffic is routed.
proxy-groups:
- name: Auto Test
type: url-test
proxies: ["Node A", "Node B", "Node C"]
url: "https://www.gstatic.com/generate_204"
interval: 300
tolerance: 50
- name: Primary and Backup
type: fallback
proxies: ["Node A", "Node B"]
url: "https://www.gstatic.com/generate_204"
interval: 120
- name: Load Distribution
type: load-balance
proxies: ["Node A", "Node B", "Node C"]
url: "https://www.gstatic.com/generate_204"
interval: 300
strategy: consistent-hashing
Choosing a probe interval and URL
interval is measured in seconds. The example’s 300 seconds (5 minutes) is a practical starting point for everyday use; the primary/backup group uses 120 seconds to check the primary more often. The interval is neither a request timeout nor a failover deadline. Groups that are not in use may skip periodic checks if lazy is enabled. To keep a primary/backup group checking while idle, set lazy: false explicitly for that group, and keep the cost of probe traffic in mind.
Start with a small-response HTTPS URL that all nodes can reach. The example URL returns HTTP 204 when working normally. If several nodes all time out in the same check cycle, first compare with a known-reachable probe URL, then determine whether the issue is the probe service, DNS path, or the nodes themselves. Do not try to fix repeated timeouts across all nodes just by reducing the interval from 300 seconds to 10.
Verify proxy group behavior and troubleshoot switching issues
- First, confirm the configuration is active. In Clash Verge Rev, for example, check the active profile under “Profiles” in the sidebar, then open “Proxies” and confirm all three groups appear. If any are missing, check that the configuration loaded successfully, indentation is correct, and member names still match after the subscription update.
- Next, confirm the rule is being matched. To test rule-based routing, make sure “Rule” mode is selected under “Proxies.” Open a target site, then check “Connections” to see the matched rule and outbound route. A group’s latency checks can be working normally, but traffic will not use it if the target matches
DIRECTor another group first. - Test one selection condition at a time. For a latency test group, compare the current node with the lowest-latency node and the 50 ms tolerance. For a primary/backup group, use a separate test configuration and temporarily move a known-unavailable test member to the top. Check a new connection after health status updates, then restore the original order. For a load-balancing group, verify outbounds with separate connections; a single download’s speed cannot tell you whether distribution is working.
- Finally, check logs and timing. When a connection fails, look in “Logs” for DNS failures, connection timeouts, or configuration errors around the same time. If “Connections” already shows the backup route but the app is still waiting, first have the app open a new connection before deciding whether to adjust health checks.
TUN and system proxy settings determine how traffic enters the core; they do not change how these three proxy groups select routes. After changing the traffic capture mode, if the client does not show the target connection at all, check what traffic is being captured. If the connection appears but does not match the intended group, fix the rules. Adjust probe and failover settings only after confirming that the connection is actually routed through that group.