Choosing a Proxy Group: Lowest Latency, Failover, or Load Balancing
To automatically select a node with low probe latency, use url-test. To prefer a primary route and switch to a backup only if it fails, use fallback. To distribute connections across available nodes, use load-balance. If a site needs to see a fixed egress IP, test a dedicated node instead of relying on an automatic group to keep the same egress.
| Type | How it selects | Best for |
|---|---|---|
url-test | Probe latency and switching tolerance | Several candidate routes in the same region; fewer manual speed tests and switches |
fallback | First healthy member in the list | A clear primary and backup, with failback to the primary when it recovers |
load-balance | Distributing connections across healthy members according to a strategy | Many independent tasks that should be spread across multiple egress nodes |
These examples use Mihomo, the successor project to Clash Meta, as the configuration reference. The client UI version and the core version are separate things. When checking field compatibility, refer to the core actually running and its field documentation. With older Clash cores, be sure to verify the accepted strategy values for load balancing.
YAML Examples for the Three Proxy Group Types
Add these three entries to the existing Profile's proxy-groups list. If the file already has this top-level key, keep its existing entries and append these; do not declare the key a second time. Replace “Route A,” “Route B,” and “Route C” with the exact names of nodes under proxies in your config, including spaces. These snippets define proxy groups only; connection settings for the nodes come from the existing config.
proxy-groups:
- name: Auto Test
type: url-test
proxies: ["Route A", "Route B", "Route C"]
url: https://www.gstatic.com/generate_204
interval: 300
tolerance: 50
- name: Primary/Backup
type: fallback
proxies: ["Route A", "Route B", "Route C"]
url: https://www.gstatic.com/generate_204
interval: 60
- name: Connection Balancing
type: load-balance
strategy: consistent-hashing
proxies: ["Route A", "Route B", "Route C"]
url: https://www.gstatic.com/generate_204
interval: 300
First, confirm traffic actually reaches the target group
In rule mode, rules are matched from top to bottom, and the matching rule determines which proxy group handles the traffic. Adding a proxy group alone does not send existing connections to it. To compare the three behaviors side by side, point a narrowly scoped rule to a manual-selection group, then add the three automatic groups as its members. Switch only the manual group between tests and leave the rest of the config unchanged.
url-test: Use tolerance to avoid switching for minor latency differences
url-test compares how long each node takes to reach the same test URL. In this example, interval: 300 sets a probe interval of five minutes, in seconds. tolerance: 50 is measured in milliseconds and helps prevent a switch over a small latency difference while the current node is still healthy.
Use sample latency readings to understand tolerance
- Suppose Route A measures 146 ms and Route B measures 118 ms, a difference of 28 ms. If the current route is healthy and the probe results are valid, that gap is not enough to exceed the 50 ms tolerance.
- If the next reading is 186 ms for A while B remains at 118 ms, the gap is 68 ms. If B is the fastest healthy member, it can then take over from A.
- If A has already been marked unavailable, first check whether the other members are healthy. Tolerance compares latency; it cannot keep a failed route in service for new connections.
These numbers illustrate how the settings work. When tuning, start by recording several readings against the same test URL. If the lead between two routes often falls in the 20–30 ms range and their rankings keep swapping, try the example's 50 ms tolerance and observe the results. If everyday use still feels sluggish, compare performance against the sites you actually use. A short request's response time does not represent large-file throughput, and the fastest node for a test URL may not be the best choice for video or downloads.
fallback: Fail over in member order
fallback uses list order to set priority. As long as Route A is considered healthy, new connections go to A first, even if Route B has lower probe latency. B is used only when A is unhealthy. If both A and B are unhealthy while C is healthy, traffic goes to C. Once A recovers and is marked healthy again, new connections can use A first.
Test failover and failback separately
- In a test Profile, put the node you want to use most often first. Enable the Profile, then use a new connection to confirm that the route includes the primary/backup group and Route A.
- In a test copy of the config, change the primary node's remote port to a port you've confirmed is closed on a test service you control. Reload the copy and confirm that the health check marks A as unavailable. Then open a new connection and check whether B takes over.
- Restore the original port, reload the config, and confirm that A's probe succeeds again. Close the old test connection, send a new request, and check whether failback follows the expected order.
interval: 60 sets the probe frequency; it is not a guaranteed failover time. Detection also depends on when the probe runs, timeouts, and whether the group is in use. An on-demand test can also affect the time you observe. An established TCP connection cannot continue over a different route; if a route fails, the application may need to reconnect.
load-balance: Round Robin vs. Consistent Hashing
Load balancing distributes connections that pass through the proxy group, not the bytes in a download. A download using a single connection won't get the combined bandwidth of three nodes just because the group has three members. A browser may also send multiple requests over the same HTTP/2 connection, so the number of page refreshes doesn't equal the number of new connections.
Keep destinations on relatively stable routes: consistent-hashing
This example uses consistent-hashing. For connections where the core receives a domain name, Mihomo hashes the registrable part of the destination domain to choose a node. For example, img.example.com and api.example.com share the registrable domain example.com; while the set of healthy members stays stable, these connections tend to use the same member. If the core receives only an IP address, don't expect it to group connections by domain. A member going down or recovering can also change the mapping, so this strategy cannot guarantee that a login session always uses the same egress.
Distribute many independent connections: round-robin
Change the example's strategy to round-robin to cycle new connections across available members. This works best for independent tasks that can use different egress nodes. Round robin distributes connections, but the amount of data sent over each can vary widely, even if three connections each use a different route. For services that require a consistent egress IP, use an earlier rule to route them through a dedicated node.
Troubleshooting probes, rules, and connection logs
- Check the active Profile and operating mode. In Clash Verge Rev, for example, first confirm on the “Profiles” page that the edited config is enabled, then check the operating mode on the “Proxies” page. In rule mode, use the “Connections” page to see whether the test request matched the expected rule and whether its route includes the target proxy group. Menu names may vary by version.
- Check that the probe URL can help identify route failures. The example URL is for short-request probes and is expected to return HTTP 204. If every node times out during a speed test, check the test URL and local DNS first, then cross-check with an HTTPS probe URL you can access reliably. Conversely, a successful probe does not prove that the destination site is reachable. If that site still fails, check its rule match and connection logs separately.
- Use a new connection for each check of the actual egress. A client-side test confirms only the probe result at that moment. When testing a switch, close any old connections that might be reused, send a new request, and check the node name. If no matching connection appears in the logs, first confirm that the application's traffic is using the enabled system proxy or TUN, then adjust the proxy group.
- Change one setting at a time. If a test group switches routes too often, check the latency difference before changing tolerance. If primary/backup behavior is unexpected, check member order and health status. If load distribution looks wrong, distinguish between destination hashing and connection reuse. Changing a group's probe interval from 300 to 60 seconds raises the configured rate from about 12 to about 60 rounds per hour; the actual number also depends on runtime conditions.
Compare what you observe with your selection goal: for url-test, check whether healthy nodes have a persistent latency difference; for fallback, check where new connections go when the primary fails and recovers; for load-balance, check whether independent connections are distributed according to the selected strategy. Confirm the behavior first, then shorten the probe interval or expand the scope of traffic being balanced.