Rate limiting
Another important technique for application resiliency is rate limiting and circuit breaking. Rate limiting helps provide the following controls to handle traffic from consumers without breaking down the provider system:
- Surge protection to prevent a system from being overloaded by a sudden spike in traffic
- Aligning the rate of incoming requests with the available capacity to process requests
- Protecting slow providers from fast consumers
Rate limiting is performed by configuring destination rules with a connection pool for connections to upstream services. Connection pool settings can be applied at the TCP level as well as the HTTP level, as described in the following configuration in Chapter5/10-connection-pooling.yaml
:
apiVersion: networking.istio.io/v1alpha3 kind: DestinationRule metadata: name: envoydummy namespace: chapter5 spec: host: envoydummy trafficPolicy: ...