Steadybit logoResilience Hub
Try SteadybitGitHub icon
Steadybit logoResilience Hub

Delay Traffic to a Backend

AttackAttack
Delay traffic to a backend
Targets:
Kubernetes NGINX Ingresses
Install now

Delay Traffic to a Backend

Delay traffic to a backend
AttackAttack
Install now

Delay Traffic to a Backend

AttackAttack
Delay traffic to a backend
Targets:
Kubernetes NGINX Ingresses
Install now

Delay Traffic to a Backend

Delay traffic to a backend
AttackAttack
Install now
Go back to list

Introduction

You can use the nginx ingress delay traffic action to delay all traffic to a specific HTTP path / HTTP Method / HTTP Headers in the ingress controller for a given time. This is useful for testing how your application behaves when specific endpoints are slowly reachable.

Requirements

Important: This action has two main requirements:

1. Enable Snippets on NGINX Ingress Controller

Snippets must be enabled on your NGINX Ingress Controller. This can be done by:

  • Adding --enable-snippets to the controller arguments
  • Or setting the enable-snippets ConfigMap option to true
  • Or for NGINX Ingress Operator: kubectl patch NginxIngress nginxingress-controller -n nginx-ingress --type=merge -p '{"spec":{"controller":{"enableSnippets":true}}}'

2. Install Custom NGINX Module

This action requires a custom NGINX module (ngx_steadybit_sleep_module) to be installed in your NGINX Ingress Controller. The module provides the sb_sleep_ms directive that enables artificial delays in HTTP request processing.

The module must be:

  1. Built and installed in your NGINX Ingress Controller image
  2. Loaded in the nginx.conf via one of these methods:
    • Add load_module modules/ngx_steadybit_sleep_module.so; directly to nginx.conf
    • Or use ConfigMap: kubectl patch configmap nginxingress-controller-nginx-ingress -n nginx-ingress --type=merge -p '{"data":{"main-snippets":"load_module /usr/lib/nginx/modules/ngx_steadybit_sleep_module.so;"}}'
  3. Compatible with your NGINX Ingress Controller version

For more information and build instructions, see the nginx_steadybit_module repository.

Use Cases

  • Understand how your services behave under network latency
  • Test application resilience under slow network conditions
  • Simulate specific endpoint performance issues

Usage

You can not apply multiple delay actions to the same ingress resource at the same time. You can not apply the nginx delay and block actions to the same ingress resource at the same time.

Rollback

The annotation made to the ingress resource will be removed automatically after the action is finished. If you want to rollback manually, you can look for the annotation nginx.ingress.kubernetes.io/configuration-snippet (or nginx.org/server-snippets for Enterprise NGINX) in the ingress resource and remove the parts that are surrounded by # BEGIN STEADYBIT - and # END STEADYBIT -. The steadybit parts in the annotation will be removed automatically after the action is finished.

Parameters

Path Pattern, HTTP Method, and HTTP Headers are optional parameters. If you do not set them, nothing will be delayed. If you set them, all requests that match the path pattern, HTTP method, and HTTP headers will be delayed.

NameRequiredDescription
DurationtrueHow long should the traffic be affected?
DelaytrueThe delay to apply to the path in milliseconds.
Path PatternfalseA regex pattern to match the paths to delay.
HTTP MethodfalseA http method to match the requests to delay. * is used as not set.
HTTP HeadersfalseA list of HTTP headers to match the requests to delay. Value is a regex pattern. If multiple headers are set, all of them must match.

More Kubernetes NGINX Ingress Actions

See all
Block traffic to a backend
Block traffic to a backend
AttackAttack
Kubernetes NGINX Ingresses
Start Using Steadybit Today

Get started with Steadybit, and you’ll get access to all of our features to discover the full power of Steadybit. Available for SaaS and on-prem!

Are you unsure where to begin?

No worries, our reliability experts are here to help: book a demo with them!

Statistics
-Stars
Tags
Kubernetes
Delay traffic
Ingress
NGINX
Latency
Homepage
hub.steadybit.com/extension/com.steadybit.extension_kubernetes
License
MIT
MaintainerSteadybit
Install now
Steadybit logoResilience Hub
Try Steadybit
© 2025 Steadybit GmbH. All rights reserved.
Twitter iconLinkedIn iconGitHub icon