请问客户端多个vnext流量会如何路由? #3070
Replies: 3 comments 5 replies
-
会随机抽一个vnext。以前v2ray 3.x没有balancer的时候曾经用过vnext来做负载均衡。 |
Beta Was this translation helpful? Give feedback.
-
it appears that V2Ray supports both random and round-robin load balancing strategies for selecting outbound VNext nodes. The strategy_random.go file contains the implementation of the RandomStrategy struct, which has a PickOutbound method that randomly selects an outbound VNext node from the list of candidates using the dice.Roll function. On the other hand, the server_picker.go file contains the implementation of the RoundRobinServerPicker struct, which implements a round-robin algorithm for selecting outbound VNext nodes. The PickServer method in this struct cycles through the list of available servers in a fixed order, returning the next server in the list for each call. The configuration file you provided seems to be using the vless protocol with multiple VNext nodes specified in the vnext array. However, it doesn't explicitly specify the load balancing strategy to be used. If the load balancing strategy is not explicitly specified in the configuration, V2Ray likely uses a default strategy. Based on your observation that the PickServer function from the RoundRobinServerPicker is being called, it appears that the default load balancing strategy in your case is round-robin. To change the load balancing strategy to random, you would need to modify the configuration file and add the balancingStrategy option under the outbounds section, like this:
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
是会将流量一分为多地发送给多个vnext吗?还是会只发送给第一个呢?
Beta Was this translation helpful? Give feedback.
All reactions