---
schema_version: "1"
id: 3bf66bc37db399b2bc8043fc19d03269cadc08c2c2d6b4957ed706afc11a7bb2
title: Configure Circuit Breaker in Local Mode
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/gateway/latest/local-circuit-breaker.md
canonical_url: https://docs.mulesoft.com/gateway/latest/local-circuit-breaker
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 82c9adca6d0ebb2bf8e7796e3ec932c50f7462d373e0e127a94d451224e84bca
description: MuleSoft Documentation Site
release: "1.14"
latest: true
---
---
product: Omni Gateway
version: 1.14
is-latest-version: true
---

# Configure Circuit Breaker in Local Mode

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

Circuit breaker protection stops Omni Gateway from overwhelming an upstream service. When the number
of connections, requests, or retries to an upstream exceeds a configured threshold, the circuit
breaker rejects requests with a `503 - Service Unavailable` error until traffic returns to within
the threshold.

Omni Gateway offers these circuit breaker thresholds:

- **Maximum Connections**  
  The maximum number of connections per API to an upstream service.

- **Maximum Pending Requests**  
  The maximum number of queued requests that can wait for a connection.

- **Maximum Requests**  
  The maximum number of outstanding requests to an upstream service.

- **Maximum Retries**  
  The maximum number of outstanding retries.

- **Maximum Connection Pools**  
  The maximum number of connection pools concurrently initiated to an upstream service.

> [!NOTE] When requests or connections exceed a threshold, Omni Gateway returns a
> `503 - Service Unavailable` error.

All thresholds are optional. For Managed Omni Gateways and Connected Mode, each API instance has its
own independent limit per upstream, so each can use the full threshold value. In Local Mode,
different API instances share limits for the same upstream. For all modes, each gateway replica can
use the full threshold value and limits aren’t distributed across replicas.

Configure circuit breaker thresholds in Local Mode via:

- Configuration YAML resource: Applies to all API instances and is easy to adjust.

- Policy: Applies to one API instance or upstream and provides granular control.

## Configure Circuit Breaker via YAML Configuration Resources

To update your circuit breaker thresholds, edit and then apply this configuration resource:

```yaml
apiVersion: gateway.mulesoft.com/v1beta1
kind: Configuration
metadata:
  name: circuit-breaker
spec:
  circuitBreaker:
    thresholds:
      maxConnections: <number>
      maxPendingRequests: <number>
      maxRequests: <number>
      maxRetries: <number>
      maxConnectionPools: <number>
```

## Configure Circuit Breaker via Policies

Apply the Circuit Breaker policy to your API instance or upstream service:

- [Circuit Breaker Policy](https://docs.mulesoft.com/gateway/latest/policies-outbound-circuit-breaker)
