跳到主要内容

Smart Load Balancing

GoZen v3.0 supports multiple load balancing strategies beyond simple failover.

Strategies

Failover (Default)

Try providers in order until one succeeds.

{
"profiles": {
"default": {
"providers": ["primary", "backup"],
"strategy": "failover"
}
}
}

Round Robin

Distribute requests evenly across providers.

{
"profiles": {
"balanced": {
"providers": ["provider-a", "provider-b", "provider-c"],
"strategy": "round-robin"
}
}
}

Least Latency

Route to the provider with the lowest recent latency.

{
"profiles": {
"fast": {
"providers": ["us-east", "us-west", "eu"],
"strategy": "least-latency"
}
}
}

Least Cost

Route to the cheapest provider for the requested model.

{
"profiles": {
"budget": {
"providers": ["cheap-provider", "expensive-provider"],
"strategy": "least-cost"
}
}
}

Strategy Comparison

StrategyBest For
failoverHigh availability, primary/backup setup
round-robinEven distribution, multiple equivalent providers
least-latencyPerformance-critical applications
least-costCost optimization

Health-Aware Routing

All strategies automatically skip unhealthy providers. If a provider is marked as unhealthy by the health checker, it will be excluded from selection until it recovers.