Choosing url-test, fallback, or load-balance: How automatic proxy groups work and how to configure them
Compare how url-test, fallback, and load-balance probe, switch, and distribute connections. Learn how to configure interval, tolerance, and strategy for different use cases.
How to choose an automatic proxy group
Choose url-test when low latency is the priority; use fallback to keep a preferred exit and switch only when it fails; choose load-balance to spread separate connections across available nodes. All three types can use health checks, but the results drive latency comparisons, priority-based selection, or connection distribution, respectively. Decide how much the exit route can vary for your use case before tuning the check frequency.
| Type | How it selects a node for new connections | Best for |
|---|---|---|
url-test | Compares the probe latency of available nodes and uses a tolerance threshold to decide whether to leave the current node | Browsing websites, looking up documentation, and other traffic with many short-lived connections |
fallback | Selects the first available node in the group's configured order | Traffic with a clear primary and backup, where the primary exit should normally stay in use |
load-balance | Selects an available node for each connection according to the configured distribution strategy | Concurrent, independent tasks where the service allows connections to use different exits |
Automatic proxy groups affect routing only when traffic is actually sent to them. If a rule sends a domain to DIRECT, or matches a select group that still has a manually chosen node, even ideal probe results won't change that connection's exit. To verify routing, first check the matched rule and actual outbound in the connection details, then check the members' status in the proxy group panel.
url-test: Latency comparisons and switching tolerance
The url-test value is the HTTP probe latency measured when each node accesses the specified test URL. It is not an ICMP ping, the response time of your target website, or a measure of throughput. A test URL close to one exit may make that node rank first without making it the best choice for your actual traffic. Compare candidate nodes using the same test URL and check the results at roughly the same time.
Use tolerance to avoid switches caused by latency fluctuations
tolerance is measured in milliseconds. Suppose node A is still available at 124 ms and node B measures 105 ms. With tolerance: 30, the 19 ms difference alone won't displace the current node. If A rises to 162 ms while B stays at 105 ms, the gap grows to 57 ms, exceeding the tolerance, so B may be selected for subsequent connections. These figures illustrate how the comparison works; they are not measurements of real routes.
When tuning tolerance, watch how much the same set of nodes fluctuates over several probe rounds. If A and B differ by only 10–20 ms but frequently swap rank, try 30 ms and observe the result. If their latency has stayed 60 ms apart, an overly large tolerance may keep the slower exit in use. Tolerance helps prevent frequent switches between nodes that are still available; it is not a failure threshold.
fallback: Fail over in list order
fallback treats member order as priority. If the configured order is A, B, C, new connections continue to prefer A as long as the core considers it available, even if B has lower probe latency. B is selected only when A is unavailable; C is considered only if B is unavailable too. Once A recovers and a probe marks it available, new connections can return to A without waiting for B to fail again.
- Put your preferred exit first. Choose the primary node based on service reliability or exit requirements, not its latency in a single probe round. Where possible, avoid sharing an outage-prone upstream between the primary and backup; adding more entries won't help if they fail together.
- Verify failover with a new connection. In a test environment you control, temporarily make the primary unavailable while the group is in use. Check the health-check results, then make a new request and confirm its actual outbound.
- Verify failback too. Restore the primary, wait for the member status to update, then check whether new connections return to the preferred node. If your service must remain on the backup after a failure until someone approves switching back, use
selectfor manual control. Ordered failover is not a lock-in mechanism.
Connection limits: Switching strategies mainly affect new connections. Established TCP connections do not move to another proxy. If a long download, WebSocket, or reused browser session encounters a failure, the application will usually need to reconnect before it can use the new exit.
load-balance: Round robin and consistent hashing
load-balance distributes connections, not file chunks, and it does not combine bandwidth across nodes. A browser may send multiple requests over one HTTP/2 connection; since that connection is established only once, refreshing a page may not trigger a new assignment. So don't use repeated refreshes of the same page to test round robin, and don't expect a single download to reach the combined speed of all nodes.
round-robin: New connections rotate among available members, making this a good fit for independent concurrent tasks. Connections vary in duration and data transferred, so an even connection count does not mean each node carries the same amount of traffic.consistent-hashing: Maps traffic to members based on destination information, keeping the mapping relatively stable. It's useful when connections to the same destination should usually use the same member. It does not pin an exit by account or browser session: an app may contact separate domains for login, APIs, and static assets, and changes in member availability can also change the mapping.
For login or allowlist services that require a single exit, route the relevant domain to a fixed node or a select group with one node selected. Even with consistent hashing, don't send a cross-domain session through a load-balancing group and assume every request will use the same exit.
mihomo configuration examples and field units
The proxy-groups snippets below assume the current configuration already defines “Route A,” “Route B,” and “Route C” under proxies. Member names must match the configuration exactly. If proxy-groups already exists, merge the required entries into the existing list; don't add a second top-level key to the same YAML file. Choose a test URL that every candidate node can reach.
proxy-groups:
- name: Lowest latency
type: url-test
proxies: ["Route A", "Route B", "Route C"]
url: https://www.gstatic.com/generate_204
interval: 300
tolerance: 30
- name: Primary and backup
type: fallback
proxies: ["Route A", "Route B", "Route C"]
url: https://www.gstatic.com/generate_204
interval: 120
- name: Connection distribution
type: load-balance
proxies: ["Route A", "Route B", "Route C"]
url: https://www.gstatic.com/generate_204
interval: 300
strategy: consistent-hashing
| Field | Description | Tuning notes |
|---|---|---|
url | URL used for health-check requests | If a probe fails, first determine whether the test site is down or the node itself is unavailable |
interval | Interval between periodic checks, in seconds | 300 is 5 minutes. A shorter interval sends more probe requests; it does not guarantee service recovery within that time. |
tolerance | Latency tolerance for url-test, in milliseconds | 30 means 30 ms, not a probe timeout |
strategy | Connection distribution method for load-balance | Use consistent-hashing for relatively stable assignments by destination, or round-robin to rotate connections. |
When you reference proxy-providers with use, also check the provider's health-check settings. A group's interval does not replace health checks for provider members; the interval on a provider entry, which controls subscription updates, is not a probe interval either. Troubleshoot these separately: check whether the subscription refreshed successfully, whether members have health-check results, and whether rules actually route traffic to the group.
Troubleshooting: No switching, timeouts, or uneven distribution
First confirm that mihomo loaded the configuration, then test the result with a new connection. The original subscription, the configuration after client-side merges and overrides, and the configuration currently running in the core may differ. Editing the subscription file alone doesn't prove that the active group has the expected type. After reloading, check the following in order:
- Check the actual route. Open the client's connection view, find the destination domain for the request, and note the matched rule, proxy group, and actual outbound. If traffic isn't reaching the expected group, fix the rule order or the parent group's current selection first.
- Check the probe target. If every node in the group times out, first try accessing the configured test URL through one of the nodes, then compare it with another known-reachable test URL. If only the original test target fails, check its DNS resolution and reachability before concluding that all nodes are down.
- Check whether member status is updating. If the group has never been used, check whether
lazyis enabled; it may skip periodic probes for an idle group. Send a new connection through the group, then use the client's group testing feature to check the results. Don't assume thatinterval: 120guarantees a new result every two minutes. - Account for connection reuse. To test failover or round robin, establish several separate connections and check each connection's outbound. Don't rely only on the latency shown in the proxy panel or count multiple requests over one connection as separate samples. To test hash-based distribution, compare results for the same and different destinations, but don't expect a handful of destinations to be distributed evenly.