• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 93
  • Last Modified:

Running multiple django sites with mod_wsgi + apache

I'm currently running 50+ Django installations with mod wsgi and noticing that apache isn't dropping memory (so it just keeps holding more and more, and then the sites grind to a halt as the swap disk fills). I also host some PHP sites on these servers.

Current wsgi config looks like this:

WSGIScriptAlias / /var/www/vhosts/glenlivet/tar/src/core/wsgi.py
WSGIDaemonProcess tar.sljol.info python-path=/var/www/vhosts/glenlivet/tar/src:/var/www/vhosts/.virtualenvs/glenlivet/lib/python2.7/site-packages
<Location />
WSGIProcessGroup tar.sljol.info

Open in new window

I'm no expert, on this type of configuration, can anyone advise how best to setup each of the vhosts?

1 Solution
Steve BinkCommented:
Right off the bat, take a look at Google's docs for the WSGIDaemonProcess directive.  The specific options you'll want to investigate are:

1) processes: without specifying this option, your application is limited to a single process.  
2) threads: without specifying this option, your application will generate, at most, 15 threads.
3) maximum-requests: provides for auto-killing a thread after it has served 'x' number of a requests.
4) inactivity-timeout: provides for auto-killing a thread after not having served a request in 'x' number of seconds.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

Tackle projects and never again get stuck behind a technical roadblock.
Join Now