Autoscaling Hyperswitch router pods on Kubernetes: when your team needs it
If your self-hosted Hyperswitch stack runs on Kubernetes and traffic swings by hour, by campaign or after a processor event, the service to scale is the Router, and the Kubernetes mechanism for scaling it is the Horizontal Pod Autoscaler. The Router is the core app server that handles routing, retries, vaulting and observability, and it is the stateless part of the stack, so adding or removing its pods is the normal way to follow request volume. Your team needs autoscaling when manual replica changes can no longer keep up with the swings you see in traffic, or when a spike arrives faster than an operator can respond.
Hyperswitch documents the Router and the Scheduler as separate services. Both are backed by PostgreSQL, which runs with a master and replica setup, and by Redis, which handles caching and the scheduler queue. Scaling Router pods alone does not raise capacity past those dependencies. If the database connection limit or Redis latency is the bottleneck, extra Router pods will add load to the same constraint. Before you set a maximum, confirm in the Helm chart values which autoscaling keys the chart exposes, which resource requests and limits it sets on the Router, and how many database connections each pod opens. Those values decide how far the HPA can go in practice.
Plan the minimum and maximum replica counts with the database and Redis ceilings in view, not only the Router's own CPU use. Ask your platform or Hyperswitch contact to confirm the scale-out signal the chart is designed for and whether it can trigger on request rate or latency as well as CPU. Record the decisions in a runbook so an on-call engineer knows which limit to check first during a surge. Load test the chosen settings before go-live, because autoscaling behavior is only proven under the load it was built for.
How load reaches router pods and the limits behind them
Traffic from merchants and processors enters the cluster through the ingress layer and reaches the Router pods, which the HPA scales on load. Every Router pod depends on the same PostgreSQL master and replica, Redis, the card vault and outbound processor calls, so adding pods only helps while those shared dependencies have headroom. The Scheduler runs as a separate workload outside the Router HPA, so check its consumers and the database connections they hold alongside the Router count.
Router pods scale on the HPA while shared databases, cache, vault and processor calls cap throughput.
HPA and pod settings and when each fits
This table compares the settings a team configures for Hyperswitch router pods under the Horizontal Pod Autoscaler, with the situation where each fits and its trade-off. Read it as a list of decisions to make against your own load test results, since the exact values belong to your testing and the Helm chart, not to this page. The main takeaway is that minimum and maximum replica counts and scale-down behavior matter more on the payment path than raw CPU targets.
| Setting | When it fits | Trade-off |
|---|---|---|
| Minimum replicas | Set to the pod count your baseline transaction volume needs at quiet hours, with at least two pods so one pod restart does not stop the router | Higher minimums keep idle cost and node count up all day; confirm the floor against your own load test |
| Maximum replicas | Set high enough to absorb peak plus retry traffic and failover load, bounded by database connections and node capacity | A high ceiling can exhaust PostgreSQL connections or node pools if other limits are not checked first |
| CPU utilization target | Suits steady request-driven load where CPU tracks transactions per second closely | CPU can lag or mislead for I/O-bound calls to processors, so latency may rise before the autoscaler reacts |
| Custom or request-rate metric | Fits when requests per second or latency is a better load signal than CPU, and a metrics adapter is already in place | Requires a metrics pipeline that the autoscaler can read; adds an operational dependency to monitor |
| Scale-up behavior | Use fast, stabilized scale-up so bursts from a merchant campaign get pods before queues build | Aggressive scale-up can overshoot and spread load thin on new pods that are still warming up |
| Scale-down behavior | Use a longer stabilization window so pods are not removed during short dips between traffic waves | Slow scale-down keeps extra pods running and adds cost during off-peak periods |
| Pod CPU and memory requests | Set from measured steady-state usage in your load test, so the scheduler places pods on nodes with real headroom | Requests set too low cause overcommitted nodes; set too high, they waste capacity and reduce pod density |
| Pod CPU and memory limits | Set with headroom above typical peaks so throttling does not add latency to authorization calls | Tight limits throttle the router under spikes; loose limits can let one pod starve neighbors on a node |
| Pod density per node | Limit pods per node so each node keeps spare CPU and memory for failover and surge scheduling | Lower density raises node count and infrastructure cost; higher density reduces headroom for a node failure |
Why maximum replicas should stay high on the payment path
A low maximum replica count turns a traffic spike into failed payments. When the Horizontal Pod Autoscaler reaches its ceiling, extra requests queue or time out at the Router pods, and a customer whose payment was not processed in time simply abandons checkout. The maximum should therefore be set for the peak you must survive, not for the average day. Set the ceiling from your load test results and the expected peak, and treat a ceiling that has been hit during a real spike as a sizing defect to fix, not a sign the system is working as designed.
A high maximum is only safe when the layers behind the Router pods are sized to match it. Every additional Router pod opens more connections to PostgreSQL, reads and writes more keys in Redis, and needs node capacity to schedule on. Confirm the PostgreSQL connection limit and any pooler limit against the pod count at maximum, confirm Redis memory and throughput headroom, and confirm that your node pool can add nodes fast enough for the scale-out to complete. The Router and Scheduler share these same backends, so the ceiling belongs to the whole stack. A Router ceiling that exceeds what PostgreSQL can serve moves the bottleneck to the database, where it fails more slowly and more confusingly.
Retries and processor failover add load beyond customer traffic. When a processor slows down, retry logic and fallback routing can multiply the requests the Router handles for each customer payment, so request volume can rise even when customer checkout volume is flat. Ask your team to measure request rate per payment during a degraded-processor test, not only during normal traffic, and size the maximum with that multiplier in mind. The Hyperswitch architecture documentation is the natural starting point for mapping which backend each request path touches.
Set up HPA for router pods step by step
This sequence takes the router deployment from its chart defaults to a tested Horizontal Pod Autoscaler, with each change verified under load before the next one is made. The output is a documented scaling configuration that keeps the Scheduler producer at one pod and has evidence for how error rates, latency and database connections behave as replicas change.
Confirm chart version and router settings
Your platform engineer records the Hyperswitch Helm chart version, the Hyperswitch release it deploys, and the router deployment values currently in use, including replica count, resource blocks and any existing autoscaling flags. Check the release notes and the compatibility matrix for the Control Center and web client versions before changing anything, because a chart upgrade can alter these values on its own. Done means you have a written baseline of the values you will change, stored in version control with the environment it applies to.
Verify metrics collection for the HPA
The platform team confirms that the Kubernetes metrics API is serving pod CPU and memory values, and that any custom metric you plan to scale on, such as request rate, is exposed through an adapter that the HPA can read. If you use the hyperswitch-monitoring chart or an existing Prometheus stack, check that the router pods are being scraped at a steady interval. Done means the HPA status shows current metric values rather than unknown, for every metric you intend to use.
Set router resource requests
Platform engineers set CPU and memory requests on the router containers based on a measured baseline from a single pod under representative traffic. HPA utilization is calculated against requests, so requests that are much higher or lower than real usage make the scaling thresholds meaningless. Limits should be reviewed separately so that throttling does not mask the load signal. Done means a single router pod's request values are documented and the utilization percentage in the HPA matches observed usage during a short test.
Define minimum and maximum replicas
The team sets a minimum replica count that covers normal traffic with failure headroom, and a maximum that the database and Redis can serve without exhausting connections. Keep the maximum high enough for payment spikes and retry storms, and confirm the cap against your PostgreSQL connection limits and any pooler configuration, as the connection budget per router pod sets how far you can scale. Done means the HPA manifest contains the agreed bounds and the connection budget calculation is recorded next to it.
Confirm the Scheduler producer stays at one pod
Check that the Scheduler producer deployment is not attached to the router HPA and that its replica count remains one after the change is applied. Confirm that only the consumer is allowed to scale, following the scheduler architecture described in the Hyperswitch docs. Run the same check after each chart upgrade, since a values change can accidentally bring the producer under a broader autoscaling rule. Done means the producer shows one running pod and no HPA targets it.
Load test each change before the next
Apply one change at a time, such as a new minimum or a new utilization threshold, and run a load test against sandbox connectors using the Hyperswitch load test tooling or your own test plan. Record the HPA events, the number of router replicas over time and the throughput reached at each step. Do not stack several changes in one test because you will not know which one caused a result. Done means each change has a recorded test run with its outcome attached to it.
Verify scale-up and scale-down
During each test, the operator watches error rates, p95 or p99 latency and database connection counts as load rises and then falls. Scale-up should add router pods before latency degrades, and scale-down should release pods without dropping in-flight payments or causing a spike in connection churn. Set acceptance thresholds for these signals in advance, and treat any rise in connection errors as a reason to lower the maximum replica count. Done means both directions of scaling were observed against the agreed thresholds and the results are written into the runbook.
Document and repeat after infrastructure changes
The team writes the final HPA settings, resource requests, connection budget and test results into the operations runbook, with an owner for each value. Repeat the load test after changes to the chart, Hyperswitch release, database sizing or node pool, since any of these can shift the scaling behavior. Ask your partner or internal owner to confirm the review cadence in writing. Done means the runbook describes what each value does and when it must be retested.
Security and operational considerations for autoscaled router pods
Autoscaling changes how many router pods handle payment traffic at any moment, so the controls around those pods matter as much as the scaling thresholds. The cards below cover the pod, the permissions, the secrets, the logs, the change process and the visibility that together keep scaling events safe and auditable.
Pod security settings
Run router pods under the restricted profile of the Pod Security Standards, which limits privilege escalation, host access and root execution. Autoscaling creates new pods on demand, so any pod that starts without these settings adds risk at the moment load is highest. Check the Helm values for security context and confirm that new replicas inherit the same policy as the initial set. Review the namespace labels that enforce the standard, because a missing label is easy to miss during a chart upgrade.
Pod Security StandardsLeast-privilege RBAC for HPA changes
Limit who can edit HorizontalPodAutoscaler objects. Changing the minimum or maximum replica count alters both cost and the capacity available to the payment path, so it should not sit with every namespace editor. Grant patch and update rights on HPA resources to a small platform group, and keep read access broad enough for on-call engineers to see current settings. Review role bindings after each Hyperswitch release, since the chart may create new service accounts.
Router and vault secrets handling
Store database, Redis and vault credentials as Kubernetes Secrets, and confirm with your platform team that encryption at rest is configured for etcd, because Secrets are stored unencrypted by default. Restrict list and watch access to these Secrets, since anyone who can list them can read every credential. For higher assurance, consider an external store through the Secrets Store CSI Driver. Confirm rotation steps before autoscaling creates pods that need the new values.
Secrets good practicesKeeping card data out of pod logs
Autoscaled pods are short-lived, but their logs may outlive them. Confirm that router and vault logging settings never write card numbers, full tokens or key material to stdout, and test this with sandbox payments before go-live. Check that log shipping to the monitoring stack does not index sensitive fields. Ask your compliance team which log retention applies, since copies collected from many replicas multiply the places where data could appear.
Change control for scaling settings
Treat minimum replicas, maximum replicas and CPU or memory targets as production configuration. Store them in version control and promote them through the same review path as the rest of the Helm values. Record the reason for each change, such as a load test result or a processor onboarding, so later reviewers can connect a scaling decision to evidence. Ask your team to confirm the approval step and who may apply an emergency change outside the normal path.
Visibility into scale events
Make every scale-up and scale-down visible to operators. Alert on replica counts that sit at the maximum for long periods, because that signals the ceiling is too low or a processor is slowing responses. Watch pod restarts and readiness failures alongside scaling, since new pods that fail their deep health check add no capacity. Confirm that scaling events reach the same dashboards and alert channels used for payment success rates.
Questions teams ask before autoscaling Hyperswitch
What does autoscaling Hyperswitch router pods cost, and what drives that cost?
The cost has two parts: the one-time work of designing and tuning the Horizontal Pod Autoscaler (HPA) settings, and the recurring cost of the capacity the autoscaler is allowed to use. The one-time part depends on how many services are in scope, how much of the payment path you need to load test, and how many environments (staging, pre-production, production) must match. The recurring part depends on your minimum and maximum pod counts, node pool sizing, and the database and Redis capacity behind the router. A higher maximum costs nothing until traffic pushes pods up, but it can expose PostgreSQL connection limits and node shortages. Ask any partner for a fixed-scope quote that lists the environments, the load test runs, the Kubernetes and cloud resources you will pay for directly, and whether a retainer covers later tuning.
How long does an autoscaling tuning cycle take?
The length of a tuning cycle is set mainly by how quickly you can produce realistic load and how many changes the test results require. A cycle usually includes baseline metrics collection, a load test against the sandbox connectors, adjusting the HPA target metrics and pod bounds, and repeating the test. Each repeat needs a stable test environment and enough time for the database and Redis to show their limits. Your Kubernetes cluster must also allow nodes to be added during the test, which depends on your cloud provider's quotas. No fixed duration is set here because the supplied facts do not give one. Ask for a written timeline that names the number of test rounds and the people who must approve changes.
What must our team provide before autoscaling work starts?
Your team must provide a working Kubernetes cluster where the Hyperswitch Helm deployment runs, with access to install and change the HPA and related resources. You also need metrics collection that shows request rate, latency, CPU and memory per pod, and the database and Redis signals. Confirm current PostgreSQL sizing, including the primary and replica setup and the connection limits, because these cap how many router pods you can run. Redis capacity and its persistence settings must be known as well. For the load test, you need a non-production environment that matches production closely enough to be meaningful, plus sandbox connectors so no live processor traffic is generated. Ask any partner which of these items they expect from you and which they will prepare.
Can an internal platform team autoscale Hyperswitch without a partner?
Yes, a platform team with Kubernetes and payments experience can tune an HPA, but the work needs three skills at once: Kubernetes autoscaling, database and cache capacity, and realistic payment load testing. Most gaps appear in the load test, where teams often miss how the database connection pool and Redis behave under retries. Your team should also decide who approves changes to pod bounds on the payment path, since a wrong setting can affect authorization rates. A partner is useful when you lack one of these skills or want an independent review before go-live. Whichever route you choose, confirm who will own the settings after handover and how changes are recorded.
Does autoscaling replace capacity planning for Hyperswitch?
No. Autoscaling adjusts the number of router pods within limits you set, but it cannot create database capacity, Redis capacity or node capacity that does not exist. If PostgreSQL connection limits or Redis throughput are reached, adding pods can make latency worse instead of better. Capacity planning converts expected transactions per second into request rates, pod counts, nodes and database headroom, and the HPA then works within that plan. Keep the maximum pod count high enough for spikes and retries, but tie it to the database connection budget. Confirm with your team which capacity model sets the limits before you change the autoscaler.
How do Hyperswitch and Kubernetes upgrades affect HPA settings?
Upgrades can change resource requests, container behavior, and metrics names, so HPA settings need a recheck after each change. A Hyperswitch upgrade may change how much CPU or memory a router pod uses, which shifts the utilization target you set. Kubernetes upgrades must follow the version skew policy, which requires the kube-apiserver to move one minor version at a time before other components, so plan the HPA check into that sequence. Hyperswitch also ships roughly monthly minor releases, and some releases add required dependencies such as Superposition, which can affect startup and readiness. Rerun a short load test after each upgrade that changes the router image or the cluster version, and record the new baseline. Confirm the upgrade calendar with the partner or your own team before you lock in a tuning cycle.
Limits to confirm in your environment
Autoscaling a payment switch depends on limits that sit outside the router pods: the chart values in your release, the Kubernetes version and its support window, the node pool, the database and the processors you call. Confirm each one in your own environment before you set minimums and maximums.
Chart values and metric names
The Hyperswitch Helm chart and the autoscaling settings it exposes change between releases, so the keys you copy from a guide may not match the version you deploy. Read the values file that ships with your chosen release and confirm the exact key names for replica counts, resource requests and HPA targets. Also confirm which metric names your monitoring stack exposes to the autoscaler, since a renamed metric leaves the HPA with nothing to scale on. Check the release notes and the compatibility matrix on the releases page for the version you plan to run.
- Latest listed release
- v1.128.0
Kubernetes version and support window
Kubernetes publishes roughly three minor releases a year, and only the three most recent minor versions receive patches. A cluster on an unsupported minor version loses security fixes, which matters on a payment path. Confirm which minor version your cloud provider or distribution offers, how long it will be supported, and when your planned upgrade window falls. Autoscaling behavior and HPA API details can also shift between minor versions, so test on the version you will run in production.
- Oldest listed supported minor
- 1.35
Node pool and cluster autoscaler behavior
Adding router pods only helps if the cluster can place them. Confirm how long your cloud's node pool takes to add capacity, the maximum node count your quota allows, and whether the cluster autoscaler or equivalent scales the pool when pods go pending. Check instance availability in the zones you use, since a spike that arrives while nodes are unavailable will leave pods unscheduled. Test this with a load run rather than relying on the provider's documentation alone.
Database connection ceilings and replica lag
Every router pod opens connections to PostgreSQL, so the pod maximum is capped by what the primary and replicas accept. Confirm the maximum connections on your database, the pool size each pod uses, and the connection limit your pooler enforces. Also measure replica lag under peak write load, because a router that reads stale state from a lagging replica can produce confusing payment behavior. A higher HPA maximum does not help if the database rejects the extra connections.
Hyperswitch architectureProcessor rate limits
Scaling router pods increases the number of calls the router sends to processors, and processors enforce their own request limits and throttling. Ask each processor for its rate limits and burst policy in writing, and confirm whether limits apply per merchant account, per API key or per IP address. Your egress path, including any proxy or allow-listed addresses, may also count against a shared limit. If a processor throttles at a lower rate than your router can send, a larger maximum pod count only increases declined transactions.
Superposition dependency before upgrading
The v1.124.0 release made Superposition a required configuration dependency, so a deployment must run a Superposition service before it upgrades to that version. If your autoscaling work comes with a version upgrade, the new router pods will not start cleanly without it. Confirm whether Superposition is already deployed, how it is scaled and monitored, and whether the HPA settings you plan depend on its availability. Include it in the upgrade test plan and in the rollback steps.
Release notesHow to tell whether the HPA is working
The HPA is working when latency and error rates stay flat while load ramps, not merely when pod counts go up. Watch p95 and p99 latency and the share of failed payment requests by processor during each ramp step. If the router pods scale but latency climbs or failures appear at the same moment, the autoscaler is reacting too late, the pods are not getting enough CPU or memory, or the bottleneck has moved elsewhere. Record these numbers against the replica count on the same timeline so you can see whether each new pod actually absorbed traffic. Your own baseline and acceptable thresholds should come from the load test you run before go-live, not from a generic target.
A second check is whether pods reach the configured maximum and then stop. Reaching the maximum during a short peak is acceptable only if latency recovers quickly after the peak ends. If pods sit at the ceiling for long periods, the maxReplicas value is too low for your traffic, or the database and Redis are already saturated. That second case is the more important one to catch. Connection exhaustion on PostgreSQL, rising Redis latency, or connection pool waits often appear before router pods show high CPU. When these limits show up first, adding router pods makes the failure worse, so confirm the database and cache metrics are inside their limits at the same time the HPA is scaling. Ask your team to define which of these signals should stop further scale-out.
Scale-down needs its own evidence. Confirm that pods removed during a traffic drop finish their in-flight payment requests and that no payment is lost, duplicated or left in an uncertain state. Check termination grace periods, the readiness behavior during shutdown, and any retry logs that show requests reaching a pod being removed. Your monitoring chart and dashboards should record pod terminations alongside payment outcomes so the two can be correlated. The Hyperswitch Grafana dashboards and payment alerts topic in this group describes which rates and pod health panels to watch, and the load testing topic describes which metrics to collect during each test. Repeat the scale-down check after every infrastructure change.
How DeployOpen scopes, delivers and supports Hyperswitch autoscaling
DeployOpen plans, builds, tests and documents Hyperswitch router autoscaling inside your own Kubernetes clusters, so the scaling rules match your traffic, database limits and payment path. Each engagement starts from a written scope, and the handover leaves your platform team able to operate and tune the setup.
How we scope
- Review your expected transaction volume, peak patterns and the router capacity model your team has chosen.
- Confirm the Kubernetes distribution, cluster version, metrics pipeline and node pool layout where the router pods will run.
- Agree in writing the minimum and maximum router replicas, scaling signals, database connection limits and load tests included.
How we build
- Configure Horizontal Pod Autoscaler objects for the stateless Hyperswitch services with resource requests and scaling thresholds you approve.
- Set pod density limits and pod disruption budgets so scale-in does not remove capacity during active payment traffic.
- Test scale-out and scale-in under load in a sandbox environment, then check that PostgreSQL and Redis hold up at the maximum replica count.
How we hand over
- Deliver the manifests or Helm values in your repository, with a record of each threshold and the reason it was chosen.
- Document the maximum pod count, the reasoning for keeping it high on the payment path, and the database and Redis limits that cap it.
- Walk your platform and on-call teams through alerts for replica saturation, throttling and pods pending on nodes.
How we support
- Support engagements are fixed-scope, and ongoing support, upgrades and continuous testing are available as a retainer.
- Re-run load tests after Hyperswitch upgrades, node pool changes or database scaling, and retune thresholds from the results.
- Confirm with your team which Hyperswitch and Kubernetes versions are in scope for each retest, since version support windows change.

