Why chaos test the Hyperswitch payment critical path before go-live
A self-hosted Hyperswitch stack should be chaos tested before go-live because it has to keep authorizing payments when one of its components fails, and nothing in a normal load test shows how it behaves in that situation. The Router and Scheduler both depend on PostgreSQL, which the architecture docs describe with a master and replica setup, and on Redis, which serves caching and the scheduler queue. Each of those dependencies is a failure point on the payment path. If the primary database becomes unreachable, if a replica lags, or if Redis restarts and drops its contents, the question for your team is not whether something breaks but what customers see, which payments are retried, which are duplicated, and how quickly authorization recovers. Those answers are specific to your topology, so they have to be observed rather than assumed.
Load testing and chaos testing answer different questions. A load test confirms that the stack meets a target throughput under expected traffic, which is the job of the sizing and capacity work covered elsewhere in this group. Chaos testing deliberately removes or degrades a component while traffic is running and records what the payment flow does in response. Teams should plan a chaos test round before go-live, after any change to ingress, egress, database topology, Redis configuration or the Hyperswitch release, and before a known peak period such as a seasonal sales event. Confirm with your own change calendar which of these apply to your environment, and agree in writing who may inject faults into production-like systems and under what rollback conditions.
How the payment critical path fails
The diagram starts with merchant and PSP traffic entering through ingress and reaching the Router pods, which are the stateless hot path. From there, Router calls Redis, the PostgreSQL primary with its replica, the card vault, and outbound processor calls that leave through an egress proxy. The Scheduler producer and consumer sit alongside, sharing Redis and PostgreSQL. Dashed trust boundaries mark where traffic crosses into the cluster and out to processors, and the fault injection points are the places to check first.
Request, data and egress paths of the Hyperswitch payment critical path, with the components where faults are injected.
Which components to break and what each failure tests
Each card names one component on the payment path, the fault to inject and the payment behavior to watch. Read together, they show where a failure stays contained and where it turns into a duplicate charge, a lost webhook or a stuck payment that someone has to reconcile by hand.
Ingress into the Router
Inject latency, dropped connections and HTTP 5xx responses at the inbound path that merchant servers and client SDKs use to reach the Router. The question is whether merchant clients retry safely and whether they resend a payment create call with the same idempotency key. Check for duplicate payment intents, the error codes clients receive, and whether partial failures are visible in logs and dashboards.
Architecture docsEgress to processors
Block or slow outbound calls from the Router to processor endpoints, for example by stalling the egress proxy or cutting DNS for one connector. Observe whether the Router times out, whether it retries against the same processor, and whether it falls back to another connector through routing rules. Confirm that a timed-out authorization is not recorded as a decline and that the merchant is not charged twice when the processor later succeeds.
Router pod termination
Kill Router pods during in-flight authorizations and capture requests so the stateless tier is tested under a rolling replacement. Watch whether requests that were mid-flight complete, fail cleanly or leave a payment in a processing state. Check that webhooks for those payments still arrive and that the deep health and readiness behavior keeps traffic away from pods that cannot reach their dependencies.
Redis unavailability
Stop Redis or cut its connection while payments are running, since Redis backs caching, idempotency, locking and the scheduler queue. Observe whether duplicate-protection checks fail open or closed, whether lock contention causes payments to stall, and how long recovery takes once Redis returns. Record any scheduler tasks that are delayed or re-run after the outage.
PostgreSQL primary and replica
Fail over the primary and separately break replica reads to see how the Router handles writes during promotion and how it behaves when read traffic loses its replica. Watch for failed writes that the application reports as successful, connection pool exhaustion, and payment records that disagree with processor state. Confirm that reconciliation can recover any payment whose status was not persisted.
Self-hosting docsCard vault and Scheduler
Disrupt the card vault connection and pause the Scheduler consumer to test the two services that handle card data and deferred work. Check whether tokenized payments fail without exposing card data in logs, and whether vault errors trigger retries or hard declines. For the Scheduler, observe whether queued tasks such as card data deletion and API key expiry notices run late or run twice after recovery.
The order to test components in
The sequence moves from a baseline in a non-production environment to combined faults, and it only advances when each fault leaves steady-state payment metrics within limits. Each step adds one dependency at a time so that a failure can be traced to a single cause.
Confirm steady-state behavior on sandbox connectors
Run the Hyperswitch stack in a non-production environment with sandbox processor connectors and generate steady synthetic payment traffic that covers authorization, capture, refund and webhook delivery. The platform engineering team records success rates, p95 and p99 latency, error counts, pod health and database and Redis utilization over a full test window. This baseline is the reference for every later step, so the team should write it down with the traffic profile and the Hyperswitch release and chart versions used. The step closes when two consecutive windows fall within the agreed tolerances without manual intervention.
Confirm alerting and rollback work before injecting faults
Before any fault is injected, the on-call team checks that the dashboards and alerts they will rely on actually fire, using a harmless signal such as a deliberately failed sandbox request. They also confirm that the fault injection tool can be stopped immediately and that a named person can end the test at any time. A chaos test that cannot be observed or stopped is a production risk, so this step is a hard gate. It closes when the team has seen one alert fire and clear and has rehearsed the stop procedure.
Restart a single router pod
Terminate one Router pod under steady traffic and observe whether in-flight requests fail, whether retries from the client or processor path recover them, and how quickly the Kubernetes readiness probe removes the pod from service. This is the lowest blast-radius fault because the stateless services should be replaceable. The team checks that no payment is left in an ambiguous state by comparing payment intent status with processor-side records for the test window. The step passes when the error rate returns to baseline and there are no unreconciled payments.
Delay Redis responses
Add latency to Redis responses, for example with a network fault injector, and watch cache hit behavior, idempotency handling and any locking that depends on Redis. The goal is to confirm the router degrades in a controlled way rather than duplicating charges or stalling every request. The team should check that repeated requests with the same idempotency key still return a single outcome. The step passes only when duplicate-charge checks are clean and latency returns to baseline after the delay is removed.
Remove a database replica
Stop one PostgreSQL replica while traffic continues and confirm that read traffic moves to the remaining healthy instances without writes being affected. Record any change in connection counts and router error rates, since database capacity caps how many router pods can run. The team verifies replication lag and that the replica rejoins cleanly once restored. The step closes when read-path errors stay within tolerance and the replica is back in sync.
Fail over the primary database
Trigger a controlled primary failover in the test environment and measure the write outage window, the number of failed or retried writes, and how the router reconnects. Check that no payment record is lost or duplicated by comparing the ledger against processor transaction logs and the scheduler queue. Confirm that the scheduler producer and consumer resume without double execution. The step passes only when the reconciliation check shows no unexplained differences.
Run combined faults and reconcile everything
Only after each single-fault step has passed, combine faults such as a router pod restart during a Redis delay, or a primary failover during elevated traffic, and run the full reconciliation process afterward. The team records the test plan, timestamps, metrics, failed payment identifiers and the remediation taken for each finding, so results can be repeated after infrastructure or release changes. The sequence is complete when the combined run meets the same checks as the single-fault runs and the findings are written up with owners for fixes.
Running chaos tests on Kubernetes, managed services and cloud VMs
The self-hosting guides document Helm charts on Kubernetes, so this is the setup where you control the most fault types. You can delete router or consumer pods, cordon and drain nodes, restrict network policies between the application and PostgreSQL or Redis, and add latency to specific services with a chaos tool installed in your own cluster. Results carry the most weight here because the topology matches production.
- Pod-level faults: Kill router and scheduler pods during a payment flow and confirm that in-flight requests fail cleanly and retries behave as your settings intend.
- Node-level faults: Drain a node that hosts router replicas and check that the scheduler producer and consumer reschedule without duplicate work.
- Network faults: Apply policies that drop or delay traffic to the database, Redis, the card vault and the egress proxy, one dependency at a time.
- Blast radius controls: Scope experiments by namespace and label, and set an abort condition tied to your payment error rate.
- Stateful limits: Killing a PostgreSQL pod inside the cluster only tests failover if your operator or replica setup supports it.
Confirm that your chaos tool, admission policies and cluster RBAC allow these actions in a non-production namespace before scheduling any run.
Many teams run PostgreSQL or Redis as a managed service from their cloud provider. Fault injection here is limited by the provider: you usually cannot stop the underlying hosts, and the provider controls failover timing. Your tests can still verify how Hyperswitch reacts to connection drops, failover events, and elevated latency, but you should not assume a provider will run a forced failover on request.
- Failover triggers: Some providers offer a manual failover or reboot-with-failover option. Ask whether it is available for your tier and whether it is safe to run against a production-like instance.
- Connection disruption: You can often simulate dropped connections from the application side, for example with network policy or a proxy, without touching the managed service itself.
- Replica behavior: Confirm how read replicas are promoted and how long the router takes to reconnect, since the architecture uses a master and replica setup.
- Redis persistence: Check whether the managed Redis tier has persistence and failover enabled, because cache, idempotency and scheduler queue behavior depends on it.
- Provider terms: Read the provider's testing and disaster recovery terms before any test that could cause a service incident.
Confirm provider support for failover tests in writing before you plan a run, because the answer decides which PostgreSQL and Redis scenarios are testable at all.
Hyperswitch can also run on virtual machines in your cloud account, typically when teams manage database or cache nodes themselves. VMs give you broader fault options than managed services, including stopping instances, detaching disks and changing network rules at the host level. They also add operating system and hypervisor variables that Kubernetes-based tests do not have, so the results describe a different topology.
- Instance faults: Stop or terminate a database replica or Redis node and observe how application connections and the scheduler recover.
- Disk and storage faults: Simulate slow or detached volumes on the database host, a failure mode that managed services rarely expose.
- Host network faults: Use firewall rules or traffic shaping on the VM to test partial network loss between zones.
- Recovery steps: Document the exact restore commands, because a manual recovery that works in a test may not be written down for an on-call engineer.
- Cost and cleanup: Test instances and extra volumes add recurring cloud charges, so tag and remove them after each run.
Confirm that your cloud account's acceptable use rules and internal change process allow instance-level faults before running them against shared environments.
The Docker-based local setup and local Minikube guides let engineers rehearse experiments before they touch a shared environment. These setups run the same components in a simplified form, which makes them useful for checking scripts, abort conditions and what each payment flow logs. They cannot reproduce multi-node scheduling, zone failures, managed service failover or realistic network latency, so they should not be used to certify resilience.
- Script validation: Confirm that your fault scripts stop the right containers or pods and that they restore state after the run.
- Log and metric checks: Verify that the events you intend to record appear in logs and dashboards before you rely on them in a larger test.
- Dependency stubs: Simulate a processor timeout with a local stub or a sandbox connector, keeping in mind that sandbox behavior differs from live processors.
- Scale limits: A single machine cannot show how autoscaling or pod anti-affinity behaves under failure.
- Team practice: Use these environments to rehearse the on-call response, including who declares an incident and who decides to stop an experiment.
Treat local results as a rehearsal record, and confirm the final resilience findings on an environment that matches your production topology.
Fault injection methods and when each fits
This table compares five fault injection methods against the Hyperswitch payment path, showing what each simulates, what it can do to test data, and when it fits. Read it as a menu: start with the lowest-risk method that answers your question, and only move to disruptive faults once the recovery path is known to work in a non-production copy.
| Method | What it simulates | Risk to test data | When it fits |
|---|---|---|---|
| Pod kill on router pods | Node or process crash during an in-flight payment request | Low, if writes are idempotent and the database is untouched; in-flight requests may be left in an unknown state | First test in the sequence, to confirm Kubernetes restarts pods and that retried requests do not double-charge in the sandbox |
| Network latency or partition between router and database | Slow or split network between the application and PostgreSQL | Medium, because partial writes can commit on one side and time out on the other | After pod kill passes, to see whether timeouts and retries leave payment records consistent |
| DNS or egress blocking to processor endpoints | A processor or outbound proxy becoming unreachable, or a DNS failure on the connector path | Low for stored data, but payment attempts may show as pending and need reconciliation | When you want to confirm how connector failures surface in routing and whether fallback behavior is what you intended |
| Redis and database failover | Primary role change for Redis or PostgreSQL, including loss of cached state and scheduler queue entries | High, because cache loss, lock loss or replica lag can affect idempotency and queued tasks | Late in the sequence, only on a copy of production-like data, after the failover mechanism itself has been verified outside the test |
| Disk or resource pressure | Full disks, CPU throttling or memory limits reached on nodes or database hosts | Medium to high, since full disks can corrupt logs or stall writes, and throttling can cause partial commits | When you need to confirm alerts fire and the deep health check reports degraded dependencies before customers see errors |
What to record during each experiment
Before any fault is injected, write down a steady-state hypothesis for the payment critical path: for example, that payment success rate by processor, p95 latency on the authorize call, and webhook delivery lag stay within the ranges you saw in the previous week of normal traffic while one Router pod is removed. Set a stop condition in the same document, such as a sustained rise in failed payments for a single processor, any payment stuck in a non-terminal state beyond your agreed window, or Redis or database errors that do not clear once the fault is removed. Agree who has authority to abort, and how the fault is reverted, before the run starts. Keep the baseline and the stop thresholds in version control so the record of each run can be compared with the last one.
During each run, capture the metrics that show what the customer experienced and what the platform did about it. Track success and failure rates split by processor, error trends by error code, latency percentiles, pod restarts and readiness state, and retry counts. Then check for the failures that dashboards often hide: duplicate payment attempts, payments with no final status, refunds or captures that did not complete, reconciliation gaps between the processor report and Hyperswitch records, and webhooks that were not delivered or were delivered late. Link each panel to the Grafana dashboards your team already uses, and record the deep health check response at the start, during and after the fault, so that a failing dependency such as the database, Redis, the vault or outbound connectivity is tied to a specific timestamp. Confirm with your monitoring owner which panels and alert rules exist in your environment before you rely on them.
How much effort and cost does chaos testing a Hyperswitch deployment take?
What drives the cost of chaos testing a self-hosted Hyperswitch deployment?
The cost depends mostly on how many components are in scope, how many failure scenarios you run, and how much of the work your team can absorb. A test of ingress, the Router pods, Redis and PostgreSQL in a single non-production cluster costs far less than a program covering the Scheduler, the card vault, egress proxies and several processor sandboxes. Quotes usually split into scoping and plan design, environment preparation, experiment execution, analysis and a remediation retest. Scoping and execution are one-time work. Repeating experiments after infrastructure or release changes is the recurring part, and it is often where teams underestimate the effort. Ask any provider to itemize these phases in the written scope so you can see which ones you are paying for.
How long does a chaos testing engagement usually take?
Duration depends on the size of the environment, the number of failure modes and how quickly access and change windows are granted. No supplied figure sets a standard length, so treat any timeline as something to confirm in writing. The main time sinks are usually environment readiness, agreeing on steady-state metrics, and waiting for approved windows to run experiments that can affect shared sandboxes. Experiments on the payment path also need time for recovery observation, because a fault that looks resolved can leave retries, webhooks or scheduled tasks catching up for longer. Ask for a phased schedule with named gates, such as baseline sign-off, first experiment run and retest.
What does our team need to provide for chaos testing?
The team must provide a non-production environment that mirrors the production topology closely enough to be meaningful, along with the access needed to inject faults. Key inputs include:
- A Kubernetes namespace or cluster where fault injection is permitted, with the Hyperswitch Helm release and its dependencies deployed.
- Processor sandbox credentials for each connector in scope, so payment flows can be exercised without touching live merchants.
- Read access to dashboards, logs and traces from your monitoring stack, plus a named contact who can interpret them.
- Approved change windows and a stop procedure, including who can halt an experiment.
- A named owner for rollback and for any on-call paging that might fire during tests.
Confirm each item before the scope is signed, since missing access is one of the most common causes of delay.
Can an internal platform team run chaos testing on Hyperswitch alone?
Yes, a capable internal team can run chaos testing if it has Kubernetes and PostgreSQL operations skills, access to the payment sandboxes, and time to design experiments that match its own sizing. The harder parts are usually outside routine operations: defining steady-state payment metrics, deciding which failures are safe to inject into the Scheduler and vault paths, and documenting results in a form auditors and risk owners accept. Teams that test rarely often lose momentum between runs, so the question is whether the work will recur on a schedule. Ask whether your staff can own the recurring runs after an initial external design phase, and whether that handover is part of the quote.
What does a fixed-scope chaos testing engagement cover?
A fixed-scope engagement covers the components, failure types, environments and deliverables agreed in writing before work starts. DeployOpen works on a fixed-scope basis for most engagements, so the written scope sets what is tested, what is excluded and what evidence you receive. A typical scope names the layers in play, such as ingress, egress, the application, Redis and the database, and the order in which they are tested. It also lists the records produced, such as experiment logs, observed payment outcomes and remediation recommendations with a retest. Anything outside the scope, such as new processor connectors or changes to production topology, should be handled as a change to that scope before work proceeds.
What ongoing costs come after the first round of chaos testing?
After the first round, costs shift to repeating experiments, keeping environments current and reviewing results as the platform changes. Each Hyperswitch upgrade, infrastructure change or new processor connector can change the failure behavior of the payment path, so tests should be repeated. Upgrades are tracked in the Hyperswitch releases page, which lists each release and its compatibility matrix for Control Center and web client versions. Ongoing work can be handled internally or through a retainer for continuous testing and support, and the choice depends on how often your environment changes and how much analysis your risk owners require.
What risks should we control when running chaos experiments on payments?
The main risks are customer-facing payment failures, duplicate charges or lost webhooks, and data exposure if a fault affects the card vault or logging. Controls include running only in non-production environments with sandbox processors, setting explicit stop conditions tied to error rates, and confirming that idempotency and retry behavior work as your team expects before any experiment. Vault and key components need extra care: confirm with your compliance owner how fault injection interacts with your PCI DSS scope before testing those paths. Ask the provider to show how each experiment is halted and how its evidence is stored.
What should we ask for in a chaos testing quote?
Ask for a written scope that lists components, failure types, environments, processor sandboxes and the order of testing. Request an itemized breakdown of scoping, environment preparation, experiment execution, analysis, remediation support and retesting, so you can see which costs are one-time and which recur. Confirm who provides access and environments, what monitoring data you receive, how stop conditions are enforced, and what records are delivered at the end. Also ask which Hyperswitch version and configuration the tests target, and what happens if an upgrade changes the scope before the work is complete.
Security and data risks during fault injection
Fault injection makes payment flows fail on purpose, and that can expose card data, keys and logs in ways normal testing does not. The cards below cover the controls that keep test runs, failover paths, tooling and production triggers from creating a PCI DSS or key-handling problem.
Keep card data out of test runs
Chaos runs should use test cards and sandbox processor credentials only, never copied production payment data or replayed live requests. Confirm which card numbers the load and fault scenarios submit, and that the sandbox connectors your team uses are the ones Hyperswitch documents for testing. If a failed request is retried against a real processor during an injected network fault, a live authorization can occur, so check connector mode before each run. Record the test card set in the run plan so reviewers can see that no production PAN was in scope.
Self-hosting docsRestrict fault tools to least privilege
Fault injection tools usually need cluster-level permissions to kill pods, cut network paths or stress nodes, and those permissions can reach Secrets in the namespace running the payment stack. Give the chaos service account rights only to the namespaces and resource types each experiment names, and keep it out of the namespace holding vault and encryption key material. Review who can create or edit experiment definitions, because an experiment that targets the wrong namespace is itself an incident.
Protect the vault and keys during failover
When a pod or node is killed, the replacement must come up with the same key references and vault connectivity, not with keys copied into a plaintext file or a scratch volume. Check that the encryption service and card vault pods are not restarted in a way that writes key material to logs, environment dumps or container images. Confirm with your key custodians how a failover is audited, and whether the in-house PCI model or an external vault provider is in use, because that decides which failover events fall inside your PCI DSS scope.
In-house PCI modelScrub payment details from logs
Failure injection produces a surge of error logs, traces and retry records, and those are the places where card numbers, tokens and customer identifiers most often leak. Confirm that the logging and tracing pipeline masks card fields and that trace attributes do not include request bodies from the payment path. Set a retention limit for chaos-run logs, restrict who can query them, and check the log store before a run is shared with a vendor or an auditor.
Control who triggers production faults
Running an experiment in production can affect live merchants, so the ability to start one should sit with a named approver and an on-call engineer, not with every platform team member. Define an abort procedure that stops the experiment, restores routing and confirms payment success rates before the run starts. Record each trigger, the approver, the experiment ID and the scope in an audit trail that the security team can read. Ask your provider whether production experiments are in scope for the engagement and what approval they require.
How a fixed-scope chaos test engagement is defined
A DeployOpen chaos test engagement is fixed in scope. Scope, deliverables and timelines are agreed in writing before any fault is injected, and that document is the reference for what was tested and what counts as a pass. For a Hyperswitch payment critical path, the written scope should name the components in play: the Router service, the Scheduler producer and consumer, the PostgreSQL primary and replica, the Redis instance, the ingress path, the Squid egress proxy and the connector endpoints used for testing. It should also name the card vault, if it is in the test path, and whether the Control Center is included. A scope that says only "the payment platform" is too loose to test or to sign off.
The written scope should also fix four other things: the fault types per component (for example, pod termination, added latency, dropped connections, a replica taken offline or a processor returning errors), the environments where faults run (usually a staging cluster that mirrors production sizing, with sandbox connectors rather than live processors), the pass criteria, and the report format. Pass criteria should be measurable, such as which payment states must not be duplicated or lost, how long a retry may take, and what the deep health endpoint must report during the fault. Ask DeployOpen to show how each criterion will be measured and which metrics and logs will be collected, so the client's own dashboards can confirm the result.
Findings follow a set path. Each finding is logged with the component, fault, observed behavior, impact on payments and a proposed fix, and the client agrees which fixes are in scope for the engagement and which belong to the client's own change process. After fixes are applied, the agreed tests are rerun to confirm the result. Confirm with DeployOpen whether one retest round is included in the fixed scope, what the retest covers and what the client must provide, such as staging access and change windows.
How DeployOpen scopes, runs and supports Hyperswitch chaos testing
DeployOpen approaches chaos testing of the Hyperswitch payment critical path as a scoped security and reliability engagement inside infrastructure you control. We agree the failure scenarios, the test environment and the evidence you receive in writing before any fault is injected, so your team knows exactly what will be touched and what will be recorded.
How we scope
- Confirm which Hyperswitch components are on the payment path, including the Router, Scheduler, PostgreSQL, Redis, ingress and egress.
- Agree the failure classes to inject, such as ingress disruption, egress blocking, application pod loss, Redis unavailability and database failover.
- Set written boundaries for the test environment, sandbox connectors, blast radius and the stop conditions that end each experiment.
How we build
- Prepare a staged test order that starts with steady-state baselines and moves from the outer edge inward toward data stores.
- Configure fault injection tooling and observability so each experiment captures success and failure rates, latency and error trends.
- Run each experiment with a named owner, a rollback step and a recorded hypothesis about how payments should behave under that failure.
How we hand over
- Deliver a written findings report that lists each experiment, observed behavior, impact on payment flows and recommended fixes.
- Document the test runbook, configuration and metrics so your platform team can repeat the tests after infrastructure changes.
- Walk your engineering, security and compliance teams through the results and the retest plan before the engagement closes.
How we support
- Retest agreed fixes and confirm that the payment critical path behaves as the findings report describes.
- Offer ongoing chaos testing, upgrade validation and continuous testing as a retainer after the fixed-scope engagement ends.
- Ask for a quote that itemizes scope, environments, retests and any retainer terms so you can compare it with your own team's effort.

