[Django]-Why is uWSGI using more memory than Apache?

6πŸ‘

βœ…

It all comes down to configuration. Because most of the memory comes from your fat Python web application, actual underlying WSGI server memory use generally contributes very little.

You should go watch my PyCon talk where I cover this specific issue and how people are deceived over the defaults the different WSGI server solutions use.

http://lanyrd.com/2012/pycon/spcdg/

In short, it is a bit of a mistruth that Apache/mod_wsgi will use a lot more memory. Configure it in a comparable way to other solutions and it would use comparable memory for same Python web application.

2πŸ‘

Add next rules to project uWSGI .ini

limit memory per process in MB

limit-as=128

max requests: recycle process when in reach 5k requests

max-requests=5000
πŸ‘€b1_

Leave a comment