Scaling Open edX Celery workers

Learn how to size LMS and CMS Celery workers, split queues with the eduNEXT Celery Tutor plugin and detect a growing backlog before grading and email slow down.

On this page

When Open edX Celery workers become the bottleneck

Grading, reports, notifications and email digests running late or piling up in a queue is the usual sign that Celery workers, not web workers, have become the limit. In edx-platform, the LMS and Studio each run Celery workers that take background jobs off the request cycle: grading and score updates, report generation, notification delivery and digest emails. When these jobs wait, learners can see stale progress or missing emails even while the web pages respond quickly. A team should consider scaling these workers separately from the uWSGI web workers when queue depth grows during peak hours while web latency stays acceptable.

Tutor runs the LMS and CMS Celery workers as separate deployable components, so each can be given its own replica count and resource limits. Before changing anything, confirm which Open edX release your platform runs, because the platform's supported release guidance applies to any change: the latest named release is the only supported one, and upgrades can alter task names, queue usage and configuration. Check the current release notes for your version and confirm with your Tutor version which worker components and settings exist in your deployment.

Start by measuring rather than guessing. Record queue depth and the age of the oldest waiting task for each queue, and note when backlogs occur (for example, right after a graded assignment deadline or a scheduled report run). If a backlog clears within a few minutes, the current capacity may be adequate. If it grows steadily for hours, add worker capacity or split heavy queues so that a slow report job cannot delay grading. Keep one rule in mind: more Celery replicas also means more database and cache connections, so confirm that MySQL, MongoDB and the shared Redis or Memcached backend can handle the extra load.

Worker and queue options and when each fits

This table compares three ways to run LMS and CMS Celery workers: sharing a host with the web processes, running dedicated worker deployments per queue, and splitting queues with the eduNEXT Celery Tutor plugin. Read each row against your install size and orchestration model, and use the trade-off column to decide which option to start with and what to measure before changing it.

OptionHow it runsTrade-offBest fit
Shared host workersLMS and CMS Celery workers run beside uWSGI processes on the same serverLowest setup effort, but a long grading or report task competes with web requests for CPU and memorySingle-server installs with light enrollment and few course authors
Dedicated worker deployments per queueSeparate worker processes or containers consume named queues, scaled independently of web podsMore moving parts to monitor, but a slow queue no longer delays email or notificationsMulti-node or Kubernetes deployments managed with Tutor where queue load is uneven
eduNEXT Celery Tutor pluginAdds Tutor configuration to route tasks to separate queues and worker groupsNeeds plugin maintenance and version checks against your Open edX release, and it adds configuration to reviewTeams that already run Tutor and want queue separation without writing their own deployment manifests
Worker concurrencyNumber of worker processes or threads each Celery worker startsHigher concurrency raises throughput but also memory use and load on the database and cacheTune after you see queue depth and per-task duration, not before
Shared cache and brokerRedis or Memcached cache and the Celery broker used by web and worker processesMulti-node deployments need a shared Django cache backend, so every worker group depends on the same cache endpointConfirm the broker and cache sizing and failover plan before adding worker groups
Backlog signalGrowing queue length or task wait time while web latency stays flatShows that workers are the bottleneck, not the web tier, so adding web replicas will not clear itUse as the trigger to add worker capacity or split a queue

Sizing and splitting Celery workers step by step

This sequence takes an Open edX platform from unmeasured background work to separate Celery worker groups for LMS and CMS queues, each checked for routing, shared cache access and drain behavior under load. It gives your team a documented baseline to compare against after every change.

  1. Baseline task latency and queue depth

    Before changing anything, record how long background tasks wait and run during a normal working day and during a known busy period such as a course launch or grading run. Your platform team should capture queue depth from the broker, task duration and failure counts from the worker logs, and any error monitoring you already run. Ask DeployOpen or your own engineers to name the monitoring tool and the retention period you will use, since this determines how far back you can compare. The step is done when you have a written baseline that lists queue depth and task timings for grading, reports, notifications and email digests separately.

  2. Identify slow task families

    Group the recorded tasks by family and rank them by total time consumed, not only by the slowest single task. Grading and report generation often hold workers for long periods, while notifications and email digests tend to create many short jobs that fill a shared queue. Confirm which families share a queue today, because a long grading job blocking short notification jobs is the usual symptom that splitting resolves. The check is a ranked table that your team agrees on, with each family marked as long-running, high-volume or latency-sensitive.

  3. Install the eduNEXT Celery Tutor plugin

    On the environment where you run Tutor, install the eduNEXT Celery Tutor plugin using the standard Tutor plugin workflow, then enable it in the plugin list. Keep the change in version control with the rest of your Tutor configuration so that every environment gets the same plugin version. Confirm the plugin version against its documentation, since plugin releases must match your Tutor and Open edX release. The check is that tutor config save completes and the rendered configuration includes the plugin's worker settings, which you should review before deploying.

  4. Configure separate queues and worker groups

    Define the queues you chose in step two and map each task family to one queue through the plugin's configuration. Create a separate worker group for each queue, with its own concurrency and memory limits, and keep LMS and CMS workers distinct. Start with conservative concurrency and raise it only after measurement, because more workers compete for the same database and cache connections. The check is a configuration review in which every task family has exactly one target queue and no queue is left without a consumer.

  5. Verify routing and shared cache reachability

    After deployment, confirm each task is delivered to the intended worker group by triggering one test task per family and reading which worker logged it. Then confirm every worker can reach the shared Django cache backend, such as Redis or Memcached, by running a read and write from inside each worker container. Multi-node deployments depend on that shared cache, so an unreachable backend on one worker group causes inconsistent behavior that is hard to trace later. The step is complete when every test task lands on the expected queue and every worker passes the cache check.

  6. Load test and confirm each queue drains

    Replay a realistic load, such as a batch of grading submissions alongside a burst of notifications and a digest run, and watch each queue's depth over time. Each queue should rise during the burst and return to its baseline depth within a window your team sets in advance. If a queue never drains, check for a stuck consumer, an undersized worker group, or a task that retries without limit before adding more workers. Record the results next to the baseline so the before and after comparison is visible to reviewers.

  7. Set backlog alerts and document the runbook

    Create alerts on queue depth and oldest message age for each queue, using thresholds derived from the load test rather than defaults. Write a short runbook that explains how to read each alert, which worker group to scale first, and who approves a change to concurrency or memory limits. Ask your DeployOpen team or your own operators to confirm which alert channel the on-call rota uses. The step is done when a deliberate test backlog triggers each alert and the runbook has been walked through by the people who will respond to it.

How to spot a Celery backlog before learners notice

Operators see a backlog first in queue depth and worker health. A backlog means tasks are entering the queues faster than workers drain them. One reading means little, so look at the trend over time and compare it with the same weekday and hour in a normal week.

  • Queue depth trend: Track how many tasks wait in each queue, grouped by queue name. A line that climbs during a peak and does not fall afterward is the signal to investigate.
  • Worker liveness: Confirm that every expected worker process is connected and consuming. A worker that crashed, restarted under memory pressure or lost its broker connection can leave one queue unattended while the others look healthy.
  • Task runtime and retries: Look for tasks that run far longer than usual or retry repeatedly. A long grading or report task can hold a worker slot and delay short notification tasks queued behind it.
  • Host resources: Check CPU, memory and broker connections on worker hosts at the time of the backlog, since out-of-memory kills often end workers without a clear error.

Before changing worker counts, export the queue depth history, the worker logs for the same window, and the timestamps of the peak, then note whether the queue cleared on its own.

How web requests, Celery queues and workers connect

The path starts with a learner or author sending a request to the LMS or Studio in the web tier. Both services place tasks on the message broker, which holds them in named queues. Dedicated LMS and CMS Celery worker groups pull from those queues, so grading, reports and notifications run apart from page requests. The workers then read and write MySQL and MongoDB, use the shared cache, and pass email to an external provider across the trust boundary. Check queue depth and worker failures first, because a growing backlog appears there before learners notice slow pages.

Web requests enqueue tasks that dedicated worker groups process across a trust boundary.

Security and operational risks of worker changes

Changing Celery worker counts, queues or hosts touches more than throughput. The broker, the cache, the secrets workers hold and the task payloads they log all widen when workers are added or moved, and a careless restart can lose work. Each card below names one risk and one check the operator can run before and after a change.

Broker access scope

Every worker holds credentials to the message broker that carries Celery tasks. A worker that can publish to or consume from queues it does not own can read or reorder grading and email jobs. Check that each worker pool authenticates with its own broker user, limited to the queues it serves, and that the broker rejects connections from networks outside the worker tier. Confirm the broker settings with your Tutor and Celery configuration, not from memory.

Shared cache exposure

Multi-node deployments need a shared Django cache backend, and workers read and write to it. If the cache accepts unauthenticated connections or is reachable from learner-facing networks, anyone who reaches it can alter cached state the workers rely on. Verify that the cache listens only on the internal network, requires authentication where the backend supports it, and that worker hosts are the only clients allowed through the firewall rules.

Email and service secrets on workers

Workers send digests and notifications and call external services, so they hold SMTP credentials and API keys that the web tier may not need. Adding worker hosts copies those secrets to more machines. Check that secrets are injected from your secret store at runtime rather than written into shared configuration files, that each host has only the keys its queues use, and that rotating an SMTP password is a documented step you have rehearsed.

Task payloads in logs

Task arguments often contain user identifiers, course identifiers and sometimes email addresses or grade data. When workers log full task payloads on failure, those values land in log stores with different retention and access rules than the LMS database. Confirm which fields are logged at each level, that tracebacks are scrubbed of personal data where your privacy review requires it, and that log access follows the same role model as your learner records.

Safe drain before restart

Restarting a worker mid-task can leave grading or report jobs half complete, and some tasks will retry or run twice depending on acknowledgement settings. During a maintenance window, the safe sequence is to stop accepting new tasks, let in-flight tasks finish within a timeout, and only then stop the process. Verify this on a staging copy by queuing a long task, issuing the stop signal and checking the task outcome in the result store.

Queue changes in maintenance

Moving a task from one queue to another, or changing the worker concurrency, can strand messages already waiting in the old queue if no worker consumes it after the change. Before the change, record the queue depth per queue, plan a window where the old and new consumers both run, and confirm the old queue drains to zero. Ask your team to document who signs off the cutover and how the rollback restores the previous routing.

Questions teams ask about Celery worker scaling

How much effort does splitting Celery queues on Open edX usually take?

The effort depends less on the plugin than on how well you understand your own task load. Splitting queues means deciding which task families (grading, reports, notifications, email digests) deserve their own workers, writing the Tutor configuration for each, and proving the new layout in staging before production. Teams that already collect worker metrics and know their peak hours move through this faster. Teams starting from no baseline spend most of their time measuring first. Ask any partner to break the work into discovery, configuration, staging tests and production rollout, and to state which parts are fixed in a written scope.

Can our own team split the Celery workers without outside help?

Yes, if you have an engineer who is comfortable with Tutor, Docker or Kubernetes, and Celery, and someone who can read queue and latency metrics. The work is configuration and verification, not a code fork. The risk is in the gaps: a task moved to the wrong queue, a worker that runs out of memory under load, or a change that works in staging but not during a course launch. If your team has no one who has run Open edX in production before, a partner can review the plan and the test results, which is often a smaller engagement than building the whole change.

What do we need to provide before a partner can start?

Expect to provide access to the Tutor configuration and plugin list for your deployment, a staging environment that mirrors production closely enough to be useful, and the metrics you already collect for LMS and CMS workers, queue depth and task latency. You also need named people who can approve changes and a window for production rollout. Ask the partner to list these inputs in the written scope, along with who in your organization owns each one, so that the start date does not depend on a missing credential or a staging server that does not exist yet.

What makes the cost of a Celery split go up or down?

Four factors move the effort most. Task volume determines how many queues are worth separating and how much testing each one needs. The number of course authors matters because Studio activity drives CMS task traffic and can change which queues are busy. Email volume, including digests and notifications, often produces the largest spikes and the most tuning. The hosting model also matters: a single server, a Kubernetes cluster you run, or infrastructure with strict change control each add steps. Cost is one-time for the design and rollout, and recurring only if you keep a retainer for monitoring and tuning. Ask for the quote to show these items separately.

How do we know a Celery backlog is building before learners notice?

Watch queue depth and task age over time, not just CPU. A backlog shows as a queue that keeps growing between peaks, or as tasks that wait longer each day before they start. Grading results arriving late, report requests sitting in a pending state, and digest emails going out hours after they were due are the user-visible signs. Set alerts on queue length and oldest-task age for each queue, and compare them against a normal week. Confirm with your Tutor and monitoring stack which metrics your deployment already exports, because the exact names and collection method depend on your setup.

When should we bring in outside help for Celery scaling?

Bring in help when the cost of a mistake is high: a large course launch is near, grading or certificates must be reliable on a fixed date, or your team has not yet run Open edX worker changes in production. Outside help is also useful when the staging environment is missing, when a backlog keeps returning after a change, or when audit or change-control rules require documented test evidence. A fixed-scope engagement can cover the design, the rehearsal and the handover, and a retainer can cover monitoring and tuning afterward. Ask the partner which of these outcomes they will document in writing.

What to ask for in a scoped quote

A scoped quote for Celery worker work should price each stage separately so you can see what you are paying for: baseline measurement of queue depth, task duration and worker utilization on the LMS and CMS; plugin configuration for the eduNEXT Celery Tutor plugin, including how tasks for grading, reports, notifications and email digests are routed to named queues; worker deployment changes to the Tutor configuration or Kubernetes manifests; load validation against a replay or synthetic run that matches your enrollment peaks; monitoring setup for queue length and task failures; and handover with a runbook your operators can follow. Ask the provider which of these stages are fixed-price and which are time-and-materials, and what evidence each stage produces.

Separate the one-time work from what recurs. Queue design, the first load validation and monitoring are one-time, but the plugin must be re-checked on every Open edX upgrade, and worker settings change as your course catalog and enrollments grow. Ask whether upgrades of the plugin and Tutor are included in a retainer, how many hours of support are covered, and how a backlog incident is handled outside business hours. Confirm the current release from the Open edX release notes and ask the provider to name the Tutor and plugin versions they will target, since Open edX supports only the latest named release.

Ask three questions about release, plugin version and rollback. First, which Open edX release and Tutor version the work targets, and whether the plugin version has been tested against that release. Second, how the plugin is pinned and how changes move from staging to production. Third, the rollback plan: the exact steps to restore the previous queue configuration and worker counts, how long that takes, and whether the provider has rehearsed it. Ask for the rollback steps in writing as part of the deliverables, not as a verbal assurance.

How DeployOpen scopes and delivers Celery worker work

The sequence below moves a Celery worker engagement from a written scope to a measured, documented and supported platform. Each step ends with a check the client can see, so the work stays auditable inside their own infrastructure.

  1. Agree scope and deliverables in writing

    DeployOpen and the client agree the scope, deliverables and timeline in a written document before any work starts. The scope names the environments in scope (LMS and CMS workers, the queues they consume, and the data stores they touch), who approves changes, and what the client receives at the end. Engagements are fixed-scope, so the quote follows from this document. Done means both parties have signed off on the scope and the deliverable list.

  2. Baseline current workers and queues

    DeployOpen's engineers inspect the running deployment inside the client's own cloud account, data center or air-gapped network. They record which Celery workers exist for the LMS and CMS, which queues each one consumes, how grading, reports, notifications and email digests are routed, and the broker and result backend in use. They also collect queue depth, task runtimes and worker resource use over a period the client agrees on. Done means the client holds a written baseline that shows where tasks wait today.

  3. Design the queue split

    Using the baseline, DeployOpen proposes how to separate long-running and latency-sensitive tasks onto their own queues and workers. The design lists each queue, its consumers, its concurrency setting and the tasks routed to it, and it names the risks, such as tasks that share state or depend on ordering. The client reviews and approves the design before any change is made. Done means a signed design that maps every task type to a queue.

  4. Implement and validate queue splits

    DeployOpen implements the approved split, using the eduNEXT Celery Tutor plugin where it fits the design, and deploys it to a non-production environment first. Validation covers task routing, worker startup, retries and failure handling, and a comparison of queue depth against the baseline. Changes move to production only after the client accepts the test results. Done means test evidence exists for each queue and the client has approved the production change.

  5. Verify backlog alerts and monitoring

    DeployOpen configures the checks the client needs to spot a backlog early: queue depth, oldest task age, worker liveness and failed task counts, wired into the monitoring tools the client already runs. Thresholds are set from the baseline and agreed with the client's operations team rather than copied from a default. Done means alerts fire in a controlled test and the client's on-call team confirms they receive them.

  6. Document the operating runbook

    DeployOpen writes a runbook covering the queue map, sizing decisions, how to add or drain workers, how to respond to a backlog, restart and rollback steps, and the logs to read first. The document is written for the client's operators, who will run the platform after the engagement ends. Done means the client's operations team has walked through the runbook and confirmed it matches the live system.

  7. Hand over and offer retainer support

    DeployOpen hands over the design, test evidence, configuration, alerts and runbook, and confirms the deliverables against the signed scope. Ongoing work such as Open edX upgrades, continuous checks of queue health and changes to worker sizing can be covered by a retainer, which the client agrees separately in writing. Done means the handover checklist is signed and the client has decided whether to add retainer support.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.