# gRPC error: RESOURCE_EXHAUSTED: rate limit exceeded

- **ID:** `api/grpc-resource-exhausted-rate-limit`
- **Domain:** api
- **Category:** resource_error
- **Error Code:** `RESOURCE_EXHAUSTED`
- **Verification:** ai_generated
- **Fix Rate:** 82%

## Root Cause

The gRPC server rejected the request because the client exceeded the configured rate limit, often due to aggressive retries or high concurrency.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| gRPC 1.62.0 | active | — | — |
| Envoy 1.29.0 | active | — | — |
| Istio 1.20.0 | active | — | — |
| gRPC-Go 1.62.0 | active | — | — |

## Workarounds

1. **Implement exponential backoff with jitter in the gRPC client. Example in Go: `backoff := grpc.WithBackoffMaxDelay(5 * time.Second); conn, err := grpc.Dial(target, backoff)`.** (85% success)
   ```
   Implement exponential backoff with jitter in the gRPC client. Example in Go: `backoff := grpc.WithBackoffMaxDelay(5 * time.Second); conn, err := grpc.Dial(target, backoff)`.
   ```
2. **Reduce concurrency by limiting the number of in-flight gRPC streams using a semaphore or connection pool. For example, use a channel-based worker pool in Go.** (80% success)
   ```
   Reduce concurrency by limiting the number of in-flight gRPC streams using a semaphore or connection pool. For example, use a channel-based worker pool in Go.
   ```
3. **Contact the API provider to request a higher rate limit or check the Retry-After header in the gRPC trailing metadata for a suggested wait time.** (70% success)
   ```
   Contact the API provider to request a higher rate limit or check the Retry-After header in the gRPC trailing metadata for a suggested wait time.
   ```

## Dead Ends

- **** — Without exponential backoff, retries are sent immediately, consuming more quota and causing cascading failures. (80% fail)
- **** — Removing rate limits exposes the server to abuse and performance degradation. (90% fail)
- **** — Rate limits are often enforced at the service level regardless of protocol; REST endpoints may have similar or stricter limits. (60% fail)
