Reference documentation and code samples for the Network Services V1 API module Google::Cloud::NetworkServices::V1::ServiceLbPolicy::LoadBalancingAlgorithm.
The global load balancing algorithm to be used.
Constants
LOAD_BALANCING_ALGORITHM_UNSPECIFIED
value: 0 The type of the loadbalancing algorithm is unspecified.
SPRAY_TO_WORLD
value: 3 Balance traffic across all backends across the world proportionally based
on capacity.
SPRAY_TO_REGION
value: 4 Direct traffic to the nearest region with endpoints and capacity before
spilling over to other regions and spread the traffic from each client to
all the MIGs/NEGs in a region.
WATERFALL_BY_REGION
value: 5 Direct traffic to the nearest region with endpoints and capacity before
spilling over to other regions. All MIGs/NEGs within a region are evenly
loaded but each client might not spread the traffic to all the MIGs/NEGs
in the region.
WATERFALL_BY_ZONE
value: 6 Attempt to keep traffic in a single zone closest to the client, before
spilling over to other zones.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[],[],null,["# Network Services V1 API - Module Google::Cloud::NetworkServices::V1::ServiceLbPolicy::LoadBalancingAlgorithm (v2.4.0)\n\nVersion latestkeyboard_arrow_down\n\n- [2.4.0 (latest)](/ruby/docs/reference/google-cloud-network_services-v1/latest/Google-Cloud-NetworkServices-V1-ServiceLbPolicy-LoadBalancingAlgorithm)\n- [2.3.0](/ruby/docs/reference/google-cloud-network_services-v1/2.3.0/Google-Cloud-NetworkServices-V1-ServiceLbPolicy-LoadBalancingAlgorithm)\n- [2.2.0](/ruby/docs/reference/google-cloud-network_services-v1/2.2.0/Google-Cloud-NetworkServices-V1-ServiceLbPolicy-LoadBalancingAlgorithm)\n- [2.1.0](/ruby/docs/reference/google-cloud-network_services-v1/2.1.0/Google-Cloud-NetworkServices-V1-ServiceLbPolicy-LoadBalancingAlgorithm)\n- [2.0.1](/ruby/docs/reference/google-cloud-network_services-v1/2.0.1/Google-Cloud-NetworkServices-V1-ServiceLbPolicy-LoadBalancingAlgorithm)\n- [1.2.0](/ruby/docs/reference/google-cloud-network_services-v1/1.2.0/Google-Cloud-NetworkServices-V1-ServiceLbPolicy-LoadBalancingAlgorithm)\n- [1.1.0](/ruby/docs/reference/google-cloud-network_services-v1/1.1.0/Google-Cloud-NetworkServices-V1-ServiceLbPolicy-LoadBalancingAlgorithm)\n- [1.0.1](/ruby/docs/reference/google-cloud-network_services-v1/1.0.1/Google-Cloud-NetworkServices-V1-ServiceLbPolicy-LoadBalancingAlgorithm)\n- [0.2.0](/ruby/docs/reference/google-cloud-network_services-v1/0.2.0/Google-Cloud-NetworkServices-V1-ServiceLbPolicy-LoadBalancingAlgorithm)\n- [0.1.0](/ruby/docs/reference/google-cloud-network_services-v1/0.1.0/Google-Cloud-NetworkServices-V1-ServiceLbPolicy-LoadBalancingAlgorithm) \nReference documentation and code samples for the Network Services V1 API module Google::Cloud::NetworkServices::V1::ServiceLbPolicy::LoadBalancingAlgorithm.\n\nThe global load balancing algorithm to be used.\n\nConstants\n---------\n\n### LOAD_BALANCING_ALGORITHM_UNSPECIFIED\n\n**value:** 0 \nThe type of the loadbalancing algorithm is unspecified.\n\n### SPRAY_TO_WORLD\n\n**value:** 3 \nBalance traffic across all backends across the world proportionally based\non capacity.\n\n### SPRAY_TO_REGION\n\n**value:** 4 \nDirect traffic to the nearest region with endpoints and capacity before\nspilling over to other regions and spread the traffic from each client to\nall the MIGs/NEGs in a region.\n\n### WATERFALL_BY_REGION\n\n**value:** 5 \nDirect traffic to the nearest region with endpoints and capacity before\nspilling over to other regions. All MIGs/NEGs within a region are evenly\nloaded but each client might not spread the traffic to all the MIGs/NEGs\nin the region.\n\n### WATERFALL_BY_ZONE\n\n**value:** 6 \nAttempt to keep traffic in a single zone closest to the client, before\nspilling over to other zones."]]