Open edX(high memory usage)

Hello everyone

I have installed open edX koa on a cloud server with (7GB Ram and 2 dedicated cpu) and I use that server only for open edX but I think open edX is using a lot of memory

I have only 137M free memory !

{

         total        used        free      shared  buff/cache   available

Mem: 6.6Gi 5.2Gi 137Mi 0.0Ki 1.3Gi 1.1Gi

}

I have already found this on the web but it did not solve my problem
{
# Added in the following to /edx/app/edxapp/lms_gunicorn.py

max_requests = 1000

max_requests_jitter = 60

# Added in the following to /edx/app/edxapp/cms_gunicorn.py

max_requests = 500

max_requests_jitter = 60

}

How can I reduce the memory usage ( I only need lms and cms for now without other services like ecommerce)

Thanks

1 Like

Hi @tomg10,

The easiest way to conserve startup memory is to reduce the number of LMS and CMS gunicorn workers via the EDXAPP_WORKERS ansible variable. This is assuming you installed Koa via the native installation procedure - is that correct? Once you set that variable, you’ll need to run the playbooks again.

The default is 4 * the number of cores for the LMS, and 2 * the number of cores for the CMS. For you, that means the default is lms: 8, and cms: 4. You may want to hard-code that to lms: 4 and cms: 2, and see if it helps.

Thanks
Yes I have installed open edX( native )

You mean I should change

EDXAPP_WORKERS: !!null
to
EDXAPP_WORKERS:
lms: 4
cms: 2
#EDXAPP_WORKERS: !!null

from

/edx/app/edx_ansible/edx_ansible/playbooks/roles/edxapp/defaults/main.yml

I have tried

EDXAPP_WORKERS:
lms: 4
cms: 2

I got back 3GB free memory
but just for a moment
now it is ~130MB again

@tomg10, alright. It’s time to see what’s taking up so much of your memory. How familiar are you with Linux CLI tools for this purpose? Personally, I’m a fan of htop and atop (both of which you’ll have to apt install - they’re not there by default).

Also, can you tell how much is being taken up by the kernel cache, and how much by actual process resident memory? It’s normal for the cache to fill up to almost all available physical RAM.

Thanks Sir

here what I have got for

atop

I have only installed open edx on this server ,if you think my data are ok then it is good