title: Why is uWSGI using more memory than Apache?
body: <p>I decided to try out NGINX/uWSGI for my Django application instead of Apache/mod_wsgi. My reason for giving this a try is that I heard NGINX/uWSGI uses less memory, performs better in high traffic situations, and NGINX is great for serving static content.</p>
  
  <p>However I'm finding that uWSGI is using almost 5x more RAM than Apache.</p>
  
  <pre><code>ubuntu@domU-12-31-39-0A-9C-1A:~$ sudo ps_mem.py
   Private  +   Shared  =  RAM used       Program
  
  184.0 KiB +  31.5 KiB = 215.5 KiB       atd
  220.0 KiB +  94.0 KiB = 314.0 KiB       upstart-socket-bridge
  260.0 KiB + 101.0 KiB = 361.0 KiB       upstart-udev-bridge
  340.0 KiB +  63.0 KiB = 403.0 KiB       cron
  392.0 KiB +  82.0 KiB = 474.0 KiB       sudo
  560.0 KiB +  14.0 KiB = 574.0 KiB       dhclient3
  612.0 KiB + 189.0 KiB = 801.0 KiB       getty (6)
  816.0 KiB +  35.5 KiB = 851.5 KiB       dbus-daemon
  660.0 KiB + 359.0 KiB =   1.0 MiB       udevd (3)
  960.0 KiB +  74.0 KiB =   1.0 MiB       rsyslogd
    1.1 MiB +  38.5 KiB =   1.2 MiB       redis-server
    1.1 MiB + 146.5 KiB =   1.2 MiB       init
    1.7 MiB +   1.1 MiB =   2.9 MiB       nginx (3)
    1.3 MiB +   1.8 MiB =   3.1 MiB       sshd (3)
    7.5 MiB +  69.5 KiB =   7.6 MiB       bash
   14.4 MiB +   5.7 MiB =  20.1 MiB       apache2 (6)
   23.6 MiB + 113.0 KiB =  23.7 MiB       mysqld
   95.5 MiB +   8.6 MiB = 104.1 MiB       uwsgi (7)
  ---------------------------------
                          169.7 MiB
  =================================
  </code></pre>
  
  <p>Is this expected? </p>
  
  <p>Have I possibly configured something incorrectly? (master=true, 4 workers)</p>
  
  <p>Do you only see the benefit when the server is under stress?</p>