Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Typical memory usage for Django applications

I am deploying a Django application (DEBUG=False) on an Ubuntu server and I am seeing high memory consumption by gunicorn and celery processes.

Processes   User       Count    CPU Memory
-------------------------------------------
gunicorn    www-data    3   0.5%    193 MB
celery      celery      2   0.3%    121 MB
celery      root        1   0.0%    44.9 MB
rsyslogd    syslog      1   0.0%    31.3 MB
postgres    postgres    6   0.0%    26.5 MB

It is a pretty small application (~400 db rows) and there is no traffic to the website yet. The snapshot was taken just after power-cyclying the server.

I am trying to understand, is this memory consumption normal? What are the typical memory usages I should expect for an idle system?

There are some blogs about memory leaks in python, but for an idle system, that might not be such a big issue.

like image 955
Devang Avatar asked Jan 29 '15 00:01

Devang


1 Answers

Normally for a typical Django Application it would take 60 - 80 MB for a Django app with database connections, for a Django app which only requires a little bit of database connections, only takes up about 18 MB memory. For a more sophisticated Django app which requires queueing up tasks, send emails, database connections, user logins, etc, it would require about 130 MB. and yes Celery consumes a lot of memory, you could try using eventlet to reduce the memory consumption: Here's a link

like image 141
Fendy Heryanto Johan Avatar answered Oct 18 '22 21:10

Fendy Heryanto Johan