Hello,

the amount of memory you need depends on what Django does and how many workers
(instances of Django) you run (which usually depends on how many requests you
are getting and how I/O intensive your Django application is). For many
applications, 512 MB is enough.

Why are you worried? The only symptom you describe is that your free memory is
decreasing. This is absolutely normal. The operating system doesn't like RAM
that is sitting down doing nothing, so it will do its best to make free RAM
nearly zero. Whenever there's much RAM available, it uses more for its caches.

How much memory is your Django app consuming? You can find out by executing
"top" and pressing "M" to sort by memory usage.

Regards,

Antonis

Antonis Christofides
http://djangodeployment.com

On 2017-12-06 14:04, Etienne Robillard wrote:
> Hi all,
>
> I'm struggling to understand how django/python may allocate and unallocate
> memory when used with uWSGI.
>
> I have a Debian system running Python 2.7 and uwsgi with 2GB of RAM and 2 
> CPUs.
>
> Is that enough RAM memory for a uWSGI/Gevent based WSGI app running Django?
>
> I'm running uWSGI with the --gevent switch in order to allow cooperative
> multithreading, but my free RAM memory is always decreasing when nginx is
> running.
>
> How can I debug memory allocation in a Django/uWSGI app?
>
> I defined also in my sitecustomize.py "gc.enable()" to allow garbage
> collection, but it does not appears to make any differences.
>
> Can you recommend any libraries to debug/profile memory allocation in Python
> 2.7 ?
>
> Is Django more memory efficient with --pymalloc or by using the default linux
> malloc() ?
>
> Thank you in advance,
>
> Etienne
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f58de0a9-8a9d-cbf5-e7c9-99b898d657a2%40djangodeployment.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to