# Horizontal Scaling - CMS/LMS and Workers

**URL:** <https://discuss.openedx.org/t/horizontal-scaling-cms-lms-and-workers/13576>\
**Category:** Site Operators\
**Created:** [August 2, 2024, 6:30pm UTC](https://discuss.openedx.org/t/horizontal-scaling-cms-lms-and-workers/13576 "2024-08-02T18:30:40Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![dave](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/dave/32/263_2.png) [@dave](https://discuss.openedx.org/u/dave)\
**Post date:** [August 3, 2024, 3:28pm UTC](https://discuss.openedx.org/t/horizontal-scaling-cms-lms-and-workers/13576/2 "2024-08-03T15:28:08Z")

</div>

> [@Zachary\_Trabookis](#):
>
> If we were to use an application load balancer for the `lms-worker`, would the `lms` service need to run along side this docker container on the same machine?
> 
> How does the `lms-worker` communicate with the `lms` and vice versa? Does it use Celery with Redis backend for this?

You are correct that the communication between `lms` and `lms-worker` happens via Redis as a Celery backend.

Strictly from edx-platform’s point of view (i.e. not considering Tutor), there’s no need for `lms` and `lms-worker` to run on the same server. They do need the same code and similar configuration settings, but [edx.org](http://edx.org) has long run them as separate scaling groups. The `lms` servers render web requests to users and stick tasks onto Redis, and the `lms-worker` servers pick up those tasks and execute them.

You shouldn’t have to add a load balancer for `lms-worker` specifically–the workers will all connect to your Redis instance and take advantage of Redis’s queue-like facilities to distribute work between them.

> [@Zachary\_Trabookis](#):
>
> We’re currently not using Kubernetes.

I know much less about Tutor, but my understanding is that you’ll need to start using k8s to actually spread your load across multiple physical servers. I may be misinterpreting this, but it sounds like you might be considering an attempt to run a separate, non-k8s Tutor instance to host your lms-workers, and have it talk to your existing Tutor instance via a shared Redis. If you are _not_ considering this please ignore the rest of this post.

If you _are_ considering the above, I think it will be very painful. I guess it technically might work if you spin up a separate non-k8s Tutor instance with mostly just `lms-worker` instances and used config to point it to a shared Redis + shared MongoDB + shared file/object store (S3?) + shared MySQL + shared Elasticsearch (i.e. everything that persists data)… but I don’t know of anyone who runs it like that, and I imagine any such setup would be fragile and break in weird ways in practice because there’s going to be a bunch of non-obvious config that will need to be _just_ right (e.g. encryption/signing keys).

So I think if you want to scale out up LMS workers, the practical path forward is either going to be scaling up your hardware to be a much bigger instance, or to start venturing in to Kubernetes.

---

_[View the full topic](https://discuss.openedx.org/t/horizontal-scaling-cms-lms-and-workers/13576)._
