Clash Proxy Group Types: url-test vs. fallback vs. load-balance
Compare how url-test, fallback, and load-balance work, when to use each, and how to configure their health checks with ready-to-adapt proxy-groups examples.
How the Three Proxy Group Types Choose Nodes
url-test probes candidate nodes against the same test URL and favors the node with the lowest latency. fallback picks the first available node in the list, making it suitable for primary-and-backup setups. load-balance distributes new connections across available nodes according to a strategy, making it useful when traffic can use different exit nodes. The configuration syntax below is for Mihomo. If your client uses a different Clash core, check that it supports these fields.
| Type | Selection criteria | Best for |
|---|---|---|
url-test |
Probe latency and switching tolerance | Automatically choosing a low-latency exit from nodes serving the same purpose |
fallback |
Availability and member order | Prioritizing the primary route and switching to a backup if it goes down |
load-balance |
Availability and distribution strategy | Workloads where new connections can use different exit nodes |
url-test: Reduce Latency Without Unnecessary Switching
url-test measures how long a node takes to reach a specified URL. It does not measure download bandwidth or necessarily reflect response times for the service you care about. For example, an 80 ms probe result says nothing about video-call jitter or file transfer speeds. Choose candidates with the same intended use and suitable exit locations, then use latency to narrow them down.
proxy-groups:
- name: Lowest Latency
type: url-test
proxies:
- Node-A
- Node-B
- Node-C
url: https://www.gstatic.com/generate_204
interval: 300
timeout: 5000
tolerance: 50
lazy: false
Setting tolerance
tolerance is the switching tolerance, measured in milliseconds. Say the current node is still available at 128 ms, while another node measures 101 ms—a difference of just 27 ms. With a tolerance of 50 ms, the group stays on the current node. If the readings are 165 ms and 101 ms, the 64 ms gap exceeds the tolerance, so the group switches based on latency. These figures illustrate how the setting works; they are not benchmark results.
Start by trying tolerance: 50. If the group keeps switching between two nodes over small latency fluctuations, first check the active configuration and whether a node has been pinned manually, then consider increasing the tolerance. If a particular site is consistently slow despite stable probe results, test that site's connection separately instead of simply shortening the probe interval.
fallback: Set a Primary and Backup in Order
fallback does not pick the fastest node. As long as the first node in the list is considered available, new connections use it—even if its latency is 180 ms and a backup measures just 90 ms. If the primary becomes unavailable, the group checks the list in order and picks the next available member. Once probes confirm the primary is back, new connections prefer it again.
proxy-groups:
- name: Primary and Backup
type: fallback
proxies:
- Node-A
- Node-B
- Node-C
url: https://www.gstatic.com/generate_204
interval: 120
timeout: 5000
lazy: false
Put the primary route first, then list backups in priority order. Rather than stacking nodes that share the same failure domain, prepare a backup with a different network path. If the primary is unusable for your service but the test URL is still reachable, the group may keep selecting it. Check whether the probe URL can detect the failure you care about instead of adjusting latency tolerance, which only applies to url-test.
interval: 120 runs a periodic probe every 120 seconds; it does not mean service will recover within 120 seconds of a failure. Recovery time also depends on when the failure occurs, probe timeouts, and the application's own reconnection behavior. Existing TCP connections do not move to a backup node. The group selects a node based on its current state when the connection is re-established.
load-balance: Distribute by Destination or Connection
Mihomo's consistent-hashing uses consistent hashing, tending to send the same destination to the same node. The mapping may change when a member's availability changes. round-robin instead distributes new connections across available nodes in rotation. It balances connections, not bytes, and does not split a single TCP connection across multiple nodes to speed up a download.
proxy-groups:
- name: Multi-Connection Distribution
type: load-balance
strategy: consistent-hashing
proxies:
- Node-A
- Node-B
- Node-C
url: https://www.gstatic.com/generate_204
interval: 300
timeout: 5000
lazy: false
If your workload allows different connections to use different exit nodes, set strategy to round-robin. To test it, open multiple independent connections. Repeatedly refreshing the same browser tab may reuse an existing connection, so it doesn't prove round-robin is working.
For services sensitive to login state or source IP, a fixed node is easier to troubleshoot. Even with consistent hashing, an app may contact separate domains for login, content, and static assets. Hashing by destination does not pin an account, browser, or app to one exit node.
Health Check Settings and Configuration Merging
urlis the target for probe requests. The example URL typically returns HTTP 204, making it suitable for lightweight checks. If none of the candidate routes can reach it, switch to a lightweight endpoint that is reliably accessible without signing in, then check node availability again.intervalis in seconds;timeoutis in milliseconds. In this example,300means 5 minutes, while5000sets a 5-second timeout for each check. Don't mix them up. A timeout that's too short can mark a node unavailable during a brief slowdown; an interval that's too short increases the number of probe requests.lazy: falsekeeps periodic probes running even when the group isn't selected. This is useful for initial testing. For long-term use, if many groups list the same nodes, consider whether every group really needs to probe them continuously.- If you use
useto reference nodes fromproxy-providers, configurehealth-checkunder the relevant provider. Group-level probes apply to members listed directly underproxies. Don't use a group-levelurlas a substitute for the provider's health check settings.
Each of the three snippets shows a complete group definition, but they are not three top-level configurations to paste together. Add the - name: entries you need to the existing proxy-groups: list, keeping just one top-level key with that name. Replace 节点-A, 节点-B, and 节点-C with node names defined in your current configuration, matching punctuation and spacing exactly. Group names must be unique; if you rename a group, update any rules that reference it.
If your client rebuilds subscription settings on refresh, use its supported local override or merge feature. Save a copy of the configuration before editing, then check which configuration is active after a refresh. To test a single group, add it to an existing manual-selection group and select it from the proxy page. You don't need to change the global fallback rule first.
After Importing: Check Probes, Rules, and Connections Separately
- First, make sure the configuration loaded. Save and reload it, then look for the new group and its members on the proxy page. If the group is missing, check configuration errors, indentation, member names, and which configuration is active. Don't mistake a missing group for a failed node probe.
- Next, make sure probes are working. Run a latency test for the group from the client's proxy page and note each node's result. If every member times out, test the probe URL with a known-good node and check the timeout setting. Don't delete all the nodes at once.
- Finally, check that the rule matches. Visit a destination that should use the group, then open the connections or logs page. Check the rule that matched, the group used, and the final node. If tests pass but traffic isn't reaching the group, check rule order: once an earlier rule matches, later rules aren't considered.
- Test switching with new connections. To check primary-to-backup selection, temporarily remove the primary from a copy of the configuration and confirm that new connections use the backup. This tests member order, not failure detection. Under controlled conditions, also observe what happens when the primary goes down and comes back. To test traffic distribution, check multiple new connections rather than treating one long-lived connection as a sample.
Start with the simplest requirement: use fallback when you need a defined primary-and-backup order; use url-test to find lower-latency options among candidates serving the same purpose; use load-balance only when different exit nodes are acceptable and you actually need to distribute multiple connections.