> For the complete documentation index, see [llms.txt](https://docs.cennso.com/components/smc/latest/llms.txt) (all documentation: [llms.txt](https://docs.cennso.com/llms.txt)). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cennso.com/components/smc/latest/troubleshooting/load-control-vegas-shrinking.md).

# Vegas shrinks the inflight limit continuously

The Vegas auto-tuner reduces the inflight limit when the current 90th-percentile (P90) latency exceeds the long-term latency baseline. Sustained shrinkage means real backend capacity is degrading, or the long-term baseline (`long_ema_alpha`) is drifting upward too aggressively to track the short-term signal.

## Symptoms

- **ergw_adaptive_inflight_limit** decreases monotonically even at moderate load.
- The structured log shows repeated `gradient < 1.0` decisions.
- **ergw_adaptive_latency_p90_microseconds** trends upward over the long-term baseline.

## Possible causes

- A genuine backend problem: a PFCP peer is slow, a Diameter server is timing out, or an Authentication, Authorization, and Accounting (AAA) dependency is unhealthy.
- The Vegas long-term baseline (`long_ema_alpha`) is too aggressive, so the long-term EMA drifts upward and Vegas chases its own tail.

## Solution

To restore a stable inflight limit, identify whether the backend or the configuration is the cause.

1. Open the **api-latency** Grafana dashboard and look at outbound latency per downstream service.

2. If a downstream service shows elevated P95 or P99 latency, fix the backend. Vegas will recover once latency stabilizes.

3. If all downstreams look healthy but the long-term EMA is climbing, lower the long-term smoothing factor so the baseline stays more stable:

    ```bash
    curl -X PATCH -H 'content-type: application/merge-patch+json' \
         -d '{"vegas":{"long_ema_alpha":0.005}}' \
         http://{SMC_POD}:9090/oam/v1alpha/load_control/config
    ```

4. Watch **ergw_adaptive_inflight_limit** for at least five minutes. If it stabilizes, persist the new value in `loadControl.vegas.long_ema_alpha` in the Helm values.

5. As a safety floor, raise `min_gradient` so a single latency spike cannot halve the limit in one tick:

    ```bash
    curl -X PATCH -H 'content-type: application/merge-patch+json' \
         -d '{"vegas":{"min_gradient":0.5}}' \
         http://{SMC_POD}:9090/oam/v1alpha/load_control/config
    ```

## Read more

- [Adaptive load control technical reference — Vegas auto-tuner](https://docs.cennso.com/components/smc/latest/reference/load-control.md#vegas-auto-tuner)
- [Adaptive load control metrics](https://docs.cennso.com/components/smc/latest/observability/metrics.md#adaptive-load-control-metrics)
- [API latency dashboard](https://docs.cennso.com/components/smc/latest/observability/dashboard-api-latency.md)
