Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am running a Django app using mod_wsgi, and am trying to understand how the apache processes work.

Here is my apache httpd.conf:

<VirtualHost *:80>

    WSGIDaemonProcess processes=2 threads=15 user=django1 group=django1
    WSGIScriptAlias / /path/to/django.wsgi

I set two processes, but when I look at top, I see two processes under user django1 and two more processes under user www-data:

14035 django1  524m 350m apache2
14116 django1  499m 326m apache2
11800 root     347m 299m apache2
17486 www-data 347m 292m apache2
17689 www-data 347m 292m apache2

Why are those www-data processes there? Am I running something else and not know it? It seems like they are wasting memory. Only the two apache2 processes for user django1 processes show any CPU load. The www-data users don't have any CPU load.

share|improve this question
I tend to use FastCGI for a reason.. – Tom O'Connor Jul 24 '11 at 23:59
up vote 1 down vote accepted

When you use daemon mode and your Django application is therefore running in a separate process to main Apache processes, you still need the Apache parent process and at least one Apache child process. The later is what accepts requests and proxies them through to the mod_wsgi daemon processes. Read:

share|improve this answer
Ok, I think I understand. Is the proxy supposed to take up so much memory though? – user749618 Jul 25 '11 at 0:44
Are you still loading mod_python into your Apache. It leaks memory into Apache parent process on restarts so if you do a lot of restarts you will have problem. Note how the 'root' owned process is fat. That is the parent process and everytime Apache forks a child, it will inherit its resident memory size. So, make sure mod_python is disabled. Also make sure using mod_wsgi 3.X and have a read of – Graham Dumpleton Jul 25 '11 at 3:32
Thanks! Will look into updating mod_wsgi. – user749618 Jul 25 '11 at 15:07

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.