Autoscaling Open edX on Kubernetes: what Tutor scales and what you add
Running tutor k8s scale changes replica counts on demand, but it does not decide when those counts should change. Autoscaling is therefore a separate piece of work that you design, build and operate on top of a Tutor-managed Kubernetes deployment. Tutor supports Kubernetes deployments and plugins, and the edx-platform maintainers recommend running Open edX in production through Tutor or a service provider, so the scaling layer should sit alongside that supported deployment rather than replace the way Tutor renders and applies the manifests. Before you start, confirm which Tutor version and Kubernetes version your platform runs, and check how your current deployment stores its configuration so that an autoscaler does not fight a manual replica count on the next Tutor upgrade.
The LMS, the CMS (Studio) and the forum service do not carry the same load. Learners hitting course pages, grading and enrollment traffic drive LMS demand, authors editing courses drive CMS demand, and discussion activity drives forum demand, and these peaks rarely line up. CPU utilization alone will often lag behind the moment learners feel slowness, and it will not tell you whether a spike comes from requests, background tasks or a single hot endpoint. Plan to decide which signals each workload scales on, such as request latency or queue depth for the web tier, and to validate those signals during a rehearsal before a large course launch. Ask your team to name the latency metric and the threshold that trigger scale-out for each service, and to record who owns those values.
The autoscaler also depends on the cluster beneath it. Adding replicas only helps if the control plane can keep accepting scheduling and API calls under load, so a highly available control plane is part of the same design. The kubeadm high availability guide describes a stacked or external etcd topology with at least three control plane nodes behind a TCP load balancer on port 6443, and etcd should run with an odd number of members. Confirm your topology, your etcd backup routine and your Secrets encryption settings before you raise maximum replica counts, because a scale event that exhausts node capacity or stalls the API server will hurt every learner, not only the service that scaled.
Traffic reaches LMS, CMS and forum replicas only through the edge, and the autoscaler reads metrics from the cluster
The diagram starts at the public edge, where a load balancer hands requests to the ingress controller inside the cluster. The ingress routes learner traffic to LMS pods and author traffic to CMS pods, while forum pods serve discussion calls. All three share a Django cache and reach the data stores across a separate boundary. A metrics source feeds the horizontal autoscaler, which changes replica counts. Check that the autoscaler sees latency and queue signals, not only CPU, and that the control plane behind port 6443 has three nodes.
Request path from the public edge through the ingress to replicas, data stores and control plane.
Scaling options and when each fits
This table compares three ways to change LMS, CMS and forum replica counts, from manual edits to autoscaling on latency or queue signals. Read each row as a trade-off between build effort, what the scaler reacts to, and the risk of flapping. The main takeaway is that the simplest option is usually the right starting point until measured load shows a need for more.
| Option | Effort to build | What it reacts to and flapping risk | When a team needs it |
|---|---|---|---|
| Manual replica changes | Low. An operator sets replica counts before a known peak and lowers them afterward. | Nothing automatic. No flapping risk, but capacity lags any unplanned load change. | Fixed enrollment calendars, small learner populations or teams without on-call coverage for scaling events. |
| tutor k8s scale | Low to moderate. Tutor sets replicas for the deployments it manages, so the team still decides the numbers. | Operator intent, not live load. Changes are deliberate, so flapping is unlikely; the risk is forgetting to scale back down. | Planned launches or steady platforms where each component needs a known replica count per environment. |
| HorizontalPodAutoscaler on CPU or memory | Moderate. Needs metrics-server, resource requests set on every pod, and tuned minimum and maximum replicas. | Pod resource usage. Easy to wire up, but CPU can stay low while learners wait on the database, and memory often reflects uWSGI worker behavior rather than demand. Flapping is possible if bounds or stabilization windows are loose. | Platforms with clear, repeatable CPU pressure on LMS web pods and a team ready to verify requests and limits first. |
| Autoscaling on latency or queue signals | High. Requires a custom metrics pipeline, such as an adapter exposing request latency or Celery queue depth, plus dashboards and alert rules. | Response time or backlog. Closest to learner experience and grading delays, but sensitive to noisy metrics. Flapping risk is high without smoothing and tested thresholds. | Large enrollment platforms with a measured latency target, or Celery backlogs that stay unprocessed while CPU looks normal. |
| Per-component choices (LMS, CMS, forum) | Varies. LMS web traffic often drives the most scaling decisions, CMS load follows authoring activity, and forum replicas depend on discussion volume. | Each component has its own bottleneck, so one scaling signal rarely fits all three. Confirm each signal per component in your own environment. | Decide per component, starting with the one that shows measured pressure, and keep the others on manual or simple settings. |
Setting up autoscaling on a Tutor-managed cluster
This sequence takes a Tutor-managed Open edX deployment from a supported Kubernetes foundation to a tested autoscaling setup, with each layer verified before the next one depends on it. The end result is a cluster whose LMS, CMS and forum replicas can be scaled by hand and by policy, with the signals and limits recorded for the operations team.
Confirm the Kubernetes version and support window
The platform engineering lead checks the Kubernetes minor version against the releases page before any node is built. Confirm the end-of-life date for that version, the upgrade path to the next supported minor, and the Tutor release you plan to deploy, since each Open edX release has its own supported Kubernetes range. Record the chosen version and its end-of-life date in the runbook. Done when the team can name the date by which the cluster must be upgraded and the owner of that upgrade.
Build a highly available control plane
The infrastructure team provisions the control plane using the kubeadm high availability topology the team has chosen, either stacked etcd on at least three control plane nodes or an external etcd cluster with an odd number of members. Put a TCP load balancer in front of kube-apiserver on port 6443 and confirm it routes to every healthy control plane node. Configure etcd snapshot backups with etcdctl and rehearse a restore with etcdutl in a scratch environment. Done when a single control plane node can be stopped without losing API access and a restore has been tested.
Configure a shared cache backend
Set up Redis or Memcached as the shared Django cache for the LMS and Studio, because multi-node Open edX deployments need a cache that every replica can reach. Place the cache service inside the cluster or in a managed service you control, and confirm that the cache endpoint and credentials are stored as Kubernetes Secrets. Restrict who can read those Secrets with least-privilege RBAC. Done when a value written by one LMS pod can be read by a second LMS pod, which shows that sessions and cached data are shared across replicas.
Deploy the platform with Tutor and verify replicas
The platform engineer deploys Open edX with Tutor on the cluster, then sets replica counts for the LMS, CMS and forum services with tutor k8s scale. Check that each deployment reports the expected number of ready pods and that requests reach every replica through the ingress. Confirm that the Tutor configuration, not manual edits, holds the replica settings so that a later redeploy does not reset them. Done when the replica counts match the runbook and every pod passes its readiness checks.
Install metrics collection
Deploy a metrics pipeline in the cluster, such as Prometheus with a metrics API adapter, and confirm that node and pod CPU and memory are visible. Check that the ingress controller or load balancer exposes request count and latency so that web-tier latency can be measured. Confirm that the Open edX and Celery pods are scraped and that the data retention period meets the team's review cycle. Done when a query returns current CPU, memory and request latency for the LMS, CMS and forum deployments.
Define latency and utilization signals per component
The operations lead writes down which signal drives each component: request latency at the ingress for the LMS and CMS, CPU and memory for the forum service, and queue depth or task age for Celery workers, which Tutor does not scale for you by default. Set the target value for each signal from observed baseline data, not from a generic figure, and note the memory limits that cap uWSGI workers per pod. Done when each component has one named signal, one target and one owner, and the baseline values are stored with the runbook.
Set scale-up and scale-down policies
Create HorizontalPodAutoscaler objects, or the autoscaler your distribution supports, that reference the signals defined in the previous step. Set minimum and maximum replica counts, a stabilization window for scale-down so that short dips do not remove capacity, and a scale-up rate that the database and cache can absorb. Confirm that the autoscaler can read the metric and that the policies appear in the cluster with the expected values. Done when a controlled increase in simulated load produces a scale-up event and the replicas return to the minimum after the window closes.
Rehearse a load test before go-live
Run a load test against the LMS, CMS and forum endpoints from outside the cluster, using realistic learner paths such as course page views, enrollments and forum reads. Watch the autoscaler, the database connection counts, the cache hit rate and the Celery queue during the test, and record where the first bottleneck appears. Adjust the limits or the policy, then rerun until the target latency holds at the planned peak. Done when the test report lists the peak tested, the signals observed, the bottleneck found and the changes made, and the team has agreed the result in writing.
Which latency metrics and policies you must define yourself
Tutor gives you the mechanism to change replica counts with tutor k8s scale, but it does not decide when a replica count should change. That decision belongs to you, and it starts with choosing the signals that represent learner experience. Request latency measured at the ingress is the most direct one, because it reflects what learners feel during a quiz submission or a course page load. Pair it with worker saturation inside the uWSGI-backed LMS and CMS pods, since a pod can be busy with requests while its CPU looks moderate. Celery queue depth is a separate signal for grading, reports, notifications and email digests, because a backlog can grow while the web tier looks healthy. Forum response time needs its own measurement as well, since forum traffic can slow down independently of courseware.
CPU alone is a weak trigger for Open edX. A learner-facing slowdown is often caused by MySQL or MongoDB waiting on queries, locks or connections, and the web pods spend that time idle or blocked, so CPU stays low while latency climbs. Adding replicas in that state moves more concurrent connections onto the same database and can make the problem worse. Before you define any policy, confirm with your own load tests which signal moves first in your environment, and record where the database connection pool or cache becomes the limit. Thresholds for each signal are values to decide and test against your own traffic profile, not settings this page recommends.
Define a minimum and maximum replica count for each deployment, and set the maximum from what your data stores can serve, not from what the cluster can schedule. Choose scale-up and scale-down cooldown windows long enough that a short course launch spike does not cause repeated pod churn, and confirm how long a new pod takes to pass its readiness checks before it receives traffic. Decide in advance what happens when the data stores are the bottleneck: whether autoscaling is paused, whether an alert goes to the on-call team, and who is authorized to raise database capacity. Document these rules and rehearse them with a load test before a large enrollment date, so the policy is verified rather than assumed.
Making the Kubernetes control plane highly available
A highly available control plane keeps the API server, scheduler and controllers answering even when one node fails, which matters because autoscaling decisions depend on that API being reachable. The cards below cover the topology, the etcd data layer, the load balancer in front of the API, and the upgrade rules that keep the cluster supported over time.
Choose stacked or external etcd
In a stacked topology, etcd runs on the same nodes as the control plane. In an external topology, etcd runs on its own cluster. Stacked is simpler to build and operate, but each control plane node failure also removes an etcd member. External separates those failure domains at the cost of more machines and more certificates to manage. Decide this before the first cluster is built, because converting later is significant work. Confirm which option your Kubernetes distribution and your team's operating model support.
kubeadm HA guideOdd etcd member count
etcd needs a majority of members to agree on writes, so it should run with an odd number of members. Three members tolerate one failure and five tolerate two. For Open edX clusters that will run LMS, CMS and forum replicas under autoscaling, the Kubernetes documentation recommends five members in production. Check that member placement spreads across hosts or availability zones, since two members on one rack still fail together.
Snapshot backups with etcdctl
Kubernetes stores cluster state, including the objects that drive your Open edX replicas and autoscalers, in etcd. Take regular snapshots with etcdctl snapshot save and store them outside the cluster. Test restores on a separate environment, using etcdutl for the restore step. An untested backup is not a recovery plan. Ask your team who owns snapshot schedules, where copies live, and how long a restore takes in your environment.
TCP load balancer on port 6443
When there are several control plane nodes, clients need one stable address. Place a TCP load balancer in front of kube-apiserver on port 6443 and point kubelets, kubectl and CI jobs at it instead of an individual node. Health checks should remove a failed API server from the pool. Confirm that the load balancer is itself highly available, because a single load balancer reintroduces the single point of failure you were removing.
Upgrade order by version skew
Upgrade kube-apiserver first, one minor version at a time, then kube-controller-manager and kube-scheduler, then kubelets. Kubelets may be up to three minor versions older than kube-apiserver, so node pools can lag briefly. Plan the sequence in a maintenance window, and check that Tutor and the Open edX chart you deploy support the Kubernetes minor version you are moving to before you start.
- Allowed kubelet minor versions behind
- 3
Patch support sets upgrade cadence
Kubernetes releases about three times a year, and the project maintains only the three most recent minor releases. Patch support for each release runs for about a year, so a cluster that falls behind loses security fixes. Build a calendar that schedules a minor upgrade before the current release leaves support, and treat that date as a planning input for Open edX releases and autoscaling tests. Confirm the current end-of-life dates on the releases page when you plan.
- Minor releases maintained
- 3
Questions buyers ask about autoscaling Open edX on Kubernetes
What does autoscaling Open edX on Kubernetes cost in effort, and who does the work?
Autoscaling is mostly engineering effort, not a licence cost, because Open edX and Tutor are open source. The effort falls into three parts: configuring the Tutor Kubernetes deployment and replica counts, choosing and wiring latency metrics and scaling policies for LMS, CMS and forum pods, and running the cluster underneath (nodes, control plane, etcd backups, upgrades). A partner can be paid to design and build these parts under a written scope, while your platform team keeps ownership of the cluster and the on-call rota. Recurring costs include the metrics stack, extra nodes that autoscaling adds during peaks, and the time spent maintaining policies after each Open edX release. Ask any quote to split one-time build work from retainer support and to name who operates the control plane.
How long does autoscaling work take, and what makes it longer?
The duration depends mostly on how much of the platform already exists and how clearly load behaviour is understood. Work runs faster when the cluster is already running on a supported Kubernetes minor version, metrics are already collected, and the team can state its latency targets. It runs slower when the cluster is a bare build with no monitoring, when the control plane must be made highly available first, or when database and cache capacity are unknown. Each Kubernetes minor release receives patch support for a limited window, so an upgrade needed before scaling work adds time. Ask for a written scope with phases (baseline, policy design, load testing, handover) and a named list of prerequisites, because a fixed-scope timeline is only as reliable as those assumptions.
What does our team need to provide before autoscaling work starts?
Your team needs to provide access and decisions, not just a cluster. The main items are:
- Cluster access with the least privilege needed to deploy workloads, read metrics and change autoscaling objects, using your existing authentication model for Kubernetes users
- A metrics stack that already collects pod and request data, or agreement to add one
- Realistic load profiles: expected concurrent learners, course launch patterns, and the courseware and grading actions that dominate traffic
- Latency and error targets agreed by the business owner
- A named on-call owner for scaling alerts and for the nodes that the autoscaler adds or removes
Without these, policies get tuned against guesses. Confirm the exact access model and tooling with your security team before any work begins.
Can an internal platform team autoscale Open edX without a partner?
Yes, a capable internal team can do it, provided it has Kubernetes operations skills, Tutor experience and time for load testing. The Tutor documentation covers Kubernetes deployment and scaling commands, and the edx-platform maintainers recommend running production through a service provider or with Tutor, which signals that the path is supported but not trivial. The gaps usually appear in three places: choosing metrics that reflect learner latency rather than CPU alone, keeping the control plane highly available, and rehearsing peak traffic before a launch. A partner can fill those gaps for a fixed scope, after which your team takes the work over. Decide before starting whether you want the build handed over or operated for you.
Why don't more replicas fix a slow Open edX database?
More LMS or CMS replicas add request capacity, but they also add connections, queries and cache traffic to the same backends. If MySQL, MongoDB or the shared cache is the bottleneck, extra web pods wait in the same queue and latency can rise even as CPU use falls. Autoscaling policies based on web pod CPU can therefore keep adding pods that make the database worse. Check connection counts, query latency, cache hit rates and MongoDB growth before adding replicas. Database offload, connection pooling, a shared Django cache backend and, where relevant, a CDN for course assets are separate jobs that the autoscaler cannot replace. The edx-platform repository notes that multi-node deployments need a shared cache backend such as Redis or Memcached, which is a prerequisite for scaling out at all.
Does a managed Kubernetes service remove the control plane work?
A managed service removes some control plane work but not the decisions around it. The provider typically runs the API server and etcd, so you do not build the highly available topology yourself. You still own node pools, autoscaler configuration, Kubernetes version upgrades, workload security settings, identity integration and backup and restore plans for your application data. The upstream version skew policy still applies, so upgrade order and the supported version window matter whether or not the control plane is managed. Confirm with your provider what they back up, what you must back up, which Kubernetes versions they support and how upgrades are scheduled, and write those answers into your runbook.
How do we test autoscaling before a course launch?
Test with a rehearsal that resembles the launch, not with a single synthetic benchmark. Start with a baseline run at normal traffic, then ramp to the expected peak with the same course structure, enrollment flow, grading and forum activity you expect on launch day. Record latency at the percentiles your business owner agreed, watch database connections, cache behaviour and Celery backlog, and confirm that scale-up and scale-down happen in the time you planned. Repeat the test after any change to replica limits, node pool settings or Open edX release. Keep the results with the runbook so your on-call team can compare future incidents against them. Ask any partner to show the test plan, the load generator used and the pass criteria before testing starts.
How DeployOpen scopes and delivers Open edX autoscaling
DeployOpen approaches autoscaling for Open edX as a fixed-scope engagement inside your own Kubernetes clusters, starting from the replica and worker layout you already run. The work covers the metrics, policies, control plane and handover documents your team needs to operate the platform after the build is complete.
How we scope
- Written scope names which LMS, CMS and forum deployments are in and which replica ranges they may use.
- Scope records the latency and queue signals that will drive scaling decisions, agreed with your operations team.
- Scope states which clusters, cloud accounts or data centers the work runs in, and who holds access.
How we build
- Autoscaling rules are configured on top of the Tutor-generated Kubernetes manifests, with changes tracked in version control.
- Load tests run against a staging copy of the platform to check that replica changes reduce latency under realistic traffic.
- Control plane high availability is built to the kubeadm topology you choose, with etcd backup and restore tested before handover.
How we hand over
- Handover documents describe each scaling policy, its thresholds, its owner and the steps to change it safely.
- Runbooks cover etcd snapshot and restore, control plane failover and what to check when scaling does not trigger.
- Your team receives test results, configuration files and a walkthrough of the dashboards used to watch scaling behavior.
How we support
- Ongoing support, Kubernetes and Open edX upgrades and continuous testing are available as a retainer after handover.
- A retainer can cover re-testing scaling policies after Kubernetes minor version upgrades, within the skew rules you agree.
- Quotes follow from the written scope, so any change to clusters, metrics or platform size is priced through a scope change.

