Scaling the Hyperswitch scheduler producer and consumer: what it does and when you need it
The Hyperswitch Scheduler runs time-based work, so a platform team self-hosting Hyperswitch must size it alongside the Router that handles payment traffic. The architecture docs describe two app services, Router and Scheduler, and the Scheduler has two roles. The Producer creates scheduled tasks and places them on a queue, and the Consumer takes tasks from that queue and runs them. Redis holds the scheduler queue, and PostgreSQL holds the records the tasks act on. Two tasks named in the scheduler scope are card data deletion, which removes stored card data that has come due for deletion, and API key expiry notices, which warn merchants before a key stops working. Both can be delayed without stopping payments, but a backlog still matters because card data should not outlive its retention period.
The Producer is designed to run as a single pod, and this topic treats that as a constraint to plan around, not a setting to raise. Running several producers could enqueue the same scheduled work more than once, so scaling it the way you scale Router pods can create duplicate deletions or duplicate notices. Confirm in the architecture documentation and in the chart values for your release how the Producer is deployed and whether any replica setting applies to it. Keep any autoscaler you configure for Router pods away from the Producer deployment, and check that your monitoring alerts when the Producer pod is missing.
The Consumer is the part that scales with work volume. Plan Consumer capacity when your scheduled workload grows, such as when your merchant base expands, when card data volumes rise, or before a large batch of key expiries. The signals to watch are queue depth in Redis, the age of the oldest waiting task, and load on PostgreSQL and Redis while Consumers run. Ask your platform or Hyperswitch partner which replica settings control the Consumer in your version, and test a backlog drain in a non-production environment before you rely on it. Scheduler load also competes with payment traffic for the same database and Redis capacity, so size these together.
Only the producer is single, so consumers carry the scaling
The diagram starts with the Router, which schedules work that the single Producer pod turns into queued tasks in the Redis scheduler queue. The Producer also writes task records to PostgreSQL, so the database holds the durable state. The Consumer group pulls tasks from Redis as traffic grows and writes results back to PostgreSQL. When you review a deployment, check that exactly one producer runs, that consumers can reach both Redis and PostgreSQL, and that the consumer count changes while the producer count stays fixed.
Single producer feeds a scalable consumer group through Redis and PostgreSQL.
Which scheduled tasks you must plan capacity for
The scheduler runs background jobs on a timer, and each job adds load to the consumer, PostgreSQL and Redis. The cards below cover the task types the Hyperswitch docs name, plus the producer and retry behavior that shape how that load arrives. Confirm the exact task list for your version before you size the consumer.
Card data deletion jobs
Card data deletion removes stored card records once retention rules say they should go. The producer queues these jobs on a timer, and the consumer runs them against PostgreSQL and the card vault. Load depends on how many records reach their deletion point together, so cards saved in the same period can cause deletion spikes. Ask your vendor which deletion jobs your version runs, how batch size is set, and whether deletion calls the vault service directly or only changes database rows.
API key expiry notices
Expiry notices warn merchants that an API key is close to its end date. The producer selects keys nearing expiry, and the consumer sends each notice through the configured channel. Load per notice is light, but it grows with the number of keys across all merchant accounts, and notices can cluster on the same dates. Confirm how far ahead notices go out, which channels your version supports, and whether outbound email needs the same egress path as connector calls.
Producer timing and single instance
The producer decides which scheduled work is due and places it on the queue. Because it runs as one pod, one instance must own the timing, and a second replica could enqueue duplicate jobs. Plan capacity for the producer as a fixed single instance, and confirm with your vendor how your version prevents duplicate enqueueing before you change its replica count. The architecture doc describes the Router and Scheduler split.
Architecture docsRetries after failed tasks
When a scheduled job fails, for example because the database or an outbound call is slow, the consumer may retry it. Retries add work on top of the original schedule and can overlap with the next run. The retry count and backoff set how much extra load a single failure creates. Ask your vendor for the retry policy in your version, the maximum attempts for each task type, and what happens to a job that still fails after its last attempt.
Queue backlog during bursts
Redis holds the scheduler queue, so a backlog shows up as jobs waiting past their scheduled time. A burst of deletions or expiry notices can delay routine work and push latency onto other consumers sharing the queue. During peak periods, track queue depth and the age of the oldest waiting job. Ask your vendor which queue keys and metrics your version exposes for scheduler monitoring, and set your alert thresholds from your own load test results.
Scheduler configuration options and when each fits
This table compares the four levers that control how the Scheduler keeps up with its work: Consumer replicas, Consumer resource requests, Redis queue capacity and PostgreSQL connection headroom. Read each row against two load shapes, a steady nightly batch and a sudden spike such as a bulk expiry run. The main takeaway is that the Producer stays at one pod, so the Consumer count, the Redis queue and the database connection budget are the levers you adjust, and each key must be confirmed in the Helm values for your release.
| Lever | Steady batch load | Spike load |
|---|---|---|
| Consumer replica count | Start with a small fixed count sized to finish the batch inside its window, confirmed against your own test results | Raise the count ahead of a known event, since scaling reactively may lag the queue build-up |
| Consumer resource requests | Set CPU and memory requests to match observed usage so pods schedule predictably on your nodes | Leave headroom above steady usage so bursts do not trigger throttling or eviction |
| Redis queue capacity | Confirm memory limits and eviction policy cover the normal number of queued tasks without loss | Verify memory headroom for the peak queue depth, and alert before Redis reaches its memory ceiling |
| PostgreSQL connection headroom | Keep Scheduler connections within the pool budget shared with Router pods on the same database | Reserve connections for extra Consumer pods before scaling, since each replica opens its own pool |
| Producer replicas | Keep at one pod, as the architecture expects a single Producer | Do not add Producer replicas to absorb spikes, scale the Consumer instead |
| Key names and defaults | Confirm the exact keys and default values in the Helm values for the release you run, not from this table | Confirm the same keys again after each upgrade, since defaults can change between releases |
Why the Hyperswitch scheduler producer stays at one pod
The Producer generates scheduled tasks, such as card data deletion and API key expiry notices, and the Hyperswitch architecture docs describe it as a component that should not run as multiple replicas without coordination. If several producers each generate the same task, the same deletion or notice can be queued more than once. The Consumer is different: it takes work from the scheduler queue in Redis, so it can run in parallel and is the part that scales with traffic. Keep one producer replica and size the consumer side. Before go-live, confirm with Juspay's current documentation for your release whether any coordination mechanism exists, because the material this page draws on does not describe one.
The trade-off of a single producer is availability. While that pod restarts, new scheduled tasks are not generated, so housekeeping such as deletions and expiry notices can fall behind. Tasks already in the Redis queue should still be picked up by Consumers, which limits the gap to work that has not yet been enqueued. Plan for this by alerting on pod restarts and queue depth, and by testing how long a producer restart delays each task type in your own environment. Treat the delay as an operational window to measure, not a figure to assume.
Confirm how your deployment enforces the replica count. Check the producer's replica value in the Helm chart version you pin, whether a Horizontal Pod Autoscaler or a GitOps tool could override it, and whether a PodDisruptionBudget applies. Review the Deployment update strategy, because a rolling update can briefly run two producers during a release. Also confirm the liveness probe and restart behavior. Defaults can change between releases, so repeat this check on every upgrade, such as when moving to a later minor version like v1.128.0 from the Hyperswitch releases page.
Setting up and scaling the scheduler in your cluster
This sequence brings the Hyperswitch scheduler up in a test environment with one Producer replica and a scaled Consumer, then proves that queued tasks drain without backing up or running twice.
Confirm the Helm release and version
The platform engineering team confirms which Hyperswitch Helm chart release and application version are deployed in the test cluster, and checks that the Router, Scheduler Producer and Scheduler Consumer all reference the same image version. Before you change anything, confirm that the Superposition service is running if the target version requires it, as the v1.124.0 release notes describe. Record the chart version, image tags and the Control Center version in your change ticket. The step is done when every scheduler deployment reports the same release and the record is saved.
Verify Redis and PostgreSQL health
The database and cache owners check that the PostgreSQL primary and replica are reachable from the scheduler pods and that Redis answers requests, because Redis holds the scheduler queue and PostgreSQL stores task state. Confirm replication lag is within the range your database team defines and that Redis persistence and failover behave as your design specifies. Run a connectivity test from inside a scheduler pod rather than from a workstation. The step is done when both services respond from the scheduler namespace and the database team has signed off on the baseline.
Set the Producer to one replica
Set the scheduler Producer deployment to a single replica in the Helm values, and confirm the setting is applied in the cluster. The Producer is the component that finds due tasks and places them on the queue, and the architecture docs describe it as staying at one pod. Do not let a horizontal autoscaler or a replica count override manage this deployment. Check the Kubernetes deployment spec after apply to confirm there is one desired replica and that no autoscaler targets it. The step is done when exactly one Producer pod runs and its spec matches the values file.
Set Consumer replicas and resources
Set the Consumer replica count, CPU and memory requests and limits in the Helm values, starting from the minimum your sizing work calls for. Consumers pull tasks from the Redis queue and run them, so their count is the main lever for throughput as task volume grows. Confirm with your Hyperswitch and capacity owners which sizing ratios apply to your expected load, and document them with the values file. The step is done when the Consumer deployment shows the intended replicas and resource settings, and every Consumer pod reaches the ready state.
Deploy to the test environment
The platform team deploys the configured release to a test environment that mirrors production topology, including the same database and Redis layout and the same network path to any sandbox connectors. Use your normal GitOps or Helm pipeline so the deployed state matches the reviewed values. Watch the rollout until all Router, Producer and Consumer pods are ready and the deep health endpoint reports healthy dependencies. The step is done when the rollout completes without restarts and the scheduler logs show a single active Producer.
Run representative scheduled tasks
The QA or payments operations team triggers a set of representative scheduled tasks in the test environment, such as card data deletion and API key expiry notices, using data sized to your expected volume. Include a mix of task types and a burst that approximates a busy period, and run the same test more than once so you can compare results. Use sandbox connectors and synthetic records only. The step is done when the planned task set has been submitted and the run is recorded with its start time, volume and configuration.
Check queue depth and completion
Watch the Redis scheduler queue depth during and after each run, and confirm it rises during the burst and then returns to a low, steady level without growing across runs. Check the database for each task's final state and confirm every task completed once. Search the Consumer logs for duplicate executions of the same task identifier, which would indicate a problem that more Consumer replicas will not fix. The step is done when queue depth stays bounded, every task reaches a completed state, and no duplicate runs appear. If any check fails, adjust Consumer resources or replicas and repeat the run.
Security and operational risks in the scheduler path
The scheduler runs background work that touches stored card data, merchant notices and shared infrastructure, so its failures are not confined to one request. The cards below cover the risks we see as most worth checking before and after a self-hosted rollout, and each one names what to confirm in your own environment.
Card data deletion against the vault
Scheduled card data deletion runs against the card vault, so a bad run or a misconfigured job can remove data you still need or leave data you expected to be gone. Confirm which vault model you run, whether deletion jobs execute inside your trust boundary, and what the vault records when a deletion happens. Test deletion in a non-production environment before relying on it. Confirm the audit trail covers every deletion with the vendor.
Vault deployment modelsExpiry notices reach the right recipients
API key expiry notices are sent by the scheduler, so a wrong recipient list or a missing notice means merchants lose access to a key without warning. Check how the notice recipient is derived for each merchant and platform account, and who receives the notice when a user has left the organization. Run a test expiry against a sandbox account and confirm the message arrives at the intended address.
Redis and PostgreSQL credentials
The scheduler reads and writes the scheduler queue in Redis and task state in PostgreSQL, so its credentials give access to shared payment data, not only scheduler data. Scope each database user to the least privilege the producer and consumer need, store the credentials in your secrets manager, and rotate them on a schedule you document. Confirm which accounts the Helm values reference and whether they are shared with the router.
Alerting when the Producer is down
A single Producer pod means one failure can stop all scheduled work without any request errors on the payment path. Alert on the Producer pod's absence or restart loop separately from consumer and router alerts, because the router will keep serving payments normally. Confirm the alert routes to an on-call owner, and check that the alert fires during a planned pod eviction in your test cluster.
Consumer backlog and silent job loss
If consumers fall behind, scheduled tasks such as deletions and notices run late, and the lag may not appear in payment dashboards. Track queue depth and task age in Redis alongside consumer pod count, and decide the acceptable delay for each task type. Ask the vendor how failed or retried tasks are recorded so that a job that never completes is visible to your operators.
Scheduler scaling questions buyers ask before hiring help
Can our team scale the Hyperswitch scheduler ourselves?
Yes, if your team can run Kubernetes workloads, read Hyperswitch's architecture and watch the scheduler's queue depth and task latency. The scheduler has two roles: the producer, which finds due tasks and places them on the queue, and the consumer, which pulls tasks off the queue and runs them. The producer stays at one pod, so scaling means adding consumer capacity, and that only helps if Redis and PostgreSQL can absorb the extra work. Your team should confirm the current producer and consumer settings in the Helm chart for your release, then test the change in a non-production cluster before touching production.
What drives the effort of scheduler scaling work?
The main drivers are cluster maturity, who owns Redis and PostgreSQL, and how much load testing the change needs. Effort goes up when the Kubernetes platform, observability stack and deployment pipeline are new to the team, because the scheduler change depends on all three being reliable. It also rises when Redis or PostgreSQL are managed by a different group, since queue behavior and connection limits must be agreed with that group before the consumer count changes. Load testing adds effort because the team needs sandbox connectors, a repeatable test plan and metrics captured before and after each change.
What does the work need from our side?
The work needs access to the target cluster, a non-production environment that mirrors production sizing, and a sandbox connector setup so test payments do not reach live processors. Typical inputs are:
- Read and deploy access to the Helm release and its values files in your own repository or pipeline
- Access to the Redis and PostgreSQL instances, including connection limits, monitoring and the owners who approve changes
- Test data that reflects scheduled task volume, such as card data deletion batches and API key expiry notices
- Access to dashboards and logs from your monitoring stack so results can be measured
Confirm each item with your own platform and data owners before the work starts.
How long does scheduler scaling take?
Duration depends on scope: whether the work covers a review of current settings, a change in one environment, or a full cycle that includes load testing, runbooks and handover. A review of an existing deployment is usually shorter than a rollout that must pass load tests in a staging environment first. Time also depends on how quickly your teams approve changes to shared Redis and PostgreSQL capacity and how long each test run takes. Ask any provider for a timeline tied to named phases and to the environments and approvals the plan assumes, rather than a single number.
What does a fixed-scope quote for scheduler scaling cover?
A fixed-scope quote covers the agreed scope, deliverables and timeline written down before work starts. For this topic, a clear quote usually lists the environments in scope, the current-state review of producer and consumer configuration, the proposed consumer scaling changes, the test plan and metrics, the rollout steps, the runbook and any knowledge transfer. It should also state what is excluded, such as changes to Redis or PostgreSQL platform design, and which client inputs the schedule depends on. DeployOpen does not publish a price list, and a quote follows from that written scope.
Which parts of scheduler scaling carry the most operational risk?
The highest risk comes from raising consumer count without checking what the scheduler depends on. More consumers can increase load on Redis and PostgreSQL, exhaust database connections or slow the payment path if tasks share resources with it. Scheduled jobs such as card data deletion also need to finish within their expected windows, so a change that delays them creates compliance and data handling questions for your team. Mitigate this by testing consumer changes under realistic load, watching queue depth and database connections, and agreeing a rollback step before rollout.
Does scheduler scaling affect our compliance scope?
Scaling the scheduler does not change which systems hold card data, but it does touch a job that deletes card data, so your compliance team should review the change. The scheduler's card data deletion task is part of how stored data is handled, and a change that delays or skips it may affect your data handling controls. Ask your assessor or compliance lead to confirm how the change is evidenced, including test results and retention of logs. DeployOpen prepares systems and evidence for assessments, but independent auditors issue any audit report or attestation.
How DeployOpen scopes and supports Hyperswitch scheduler scaling
DeployOpen plans, implements, documents and supports self-hosted open-source platforms inside infrastructure you control, so scheduler scaling for Hyperswitch is handled as part of your own cluster, database and Redis setup. We start from the written scope, confirm how your scheduler is running today, and agree deliverables before any change goes into your environment.
How we scope
- Review your Hyperswitch version, Helm values and current producer and consumer replica counts before agreeing the work.
- Confirm which scheduled tasks run in your deployment, such as card data deletion and API key expiry notices, and who owns each one.
- Agree in writing how the consumer scaling approach, Redis queue and PostgreSQL capacity will be checked, and what is excluded.
How we build
- Configure the producer as a single pod and the consumer deployment with autoscaling settings that match your traffic profile.
- Test scheduler behavior under load in a non-production environment, watching queue depth and task completion before go-live.
- Confirm that Redis and PostgreSQL connection limits still hold when consumer replicas increase during peak periods.
How we hand over
- Deliver the configuration, a runbook for restarting or rescheduling the producer, and notes on which metrics show a stuck queue.
- Walk your platform and database teams through the scaling decisions, including why the producer is not horizontally scaled.
- Document the upgrade checks needed when a new Hyperswitch release changes scheduler behavior or configuration.
How we support
- Fixed-scope engagements set out deliverables and timelines in writing before work begins, with a quote following from that scope.
- Ongoing support, upgrades and continuous testing for scheduler changes are available as a retainer.
- Ask any partner to confirm how they will verify scheduler health after each Hyperswitch upgrade in your own environment.

