On Oct 31, 10:04 am, "Naitik Shah" <[EMAIL PROTECTED]> wrote:
> I'm serving a few sites from a tiny VPS, and I'm quite happy with a
> Apache/mod_wsgi setup. I've managed to reduce the Apache footprint by having
> only a few necessary modules loaded. mod_wsgi is setup to use daemon mode
> and start multiple processes per site.

How many processes in each daemon group and how many threads? A lot of
sites would work quite happily with single daemon process with a dozen
or so threads, which is what WSGIDaemonProcess gives you as default
when you do not define number of processes and threads. Thus, don't
get carried away and create more processes than you really need to.

Can you post the Apache configuration showing relationship between
sites and daemon process groups? Can then possibly comment better.

Also indicate how much traffic each site gets and whether any would
potentially be idle for periods, as can then look at inactivity
timeouts etc.

> Currently, each site has its own python-path and the system python
> installation does not contain anything but stock python modules. Each site
> has its own copy of Django and various other libraries. Is there a
> performance gain to be had by having the sites share these libraries? They
> are different processes, so I think not, but I'm not quite sure. Also,
> another benefit that I can think of is that if the files were the same, the
> OS (Linux 2.6.27) would be able to cache them better, but again I'm not
> quite sure.

The code size is generally not the issue, but runtime application
data, so doubt that having .so in different installations would result
in much being lost.

> This is probably a micro enhancement, but I'm trying hard to keep the memory
> consumption low.
>
> -Naitik
>
> ps: Another enhancement I'm looking into when I have time is the event mpm,
> but that one requires me to give up my distro apache. Thoughts?

Rather than event MPM, would suggest using nginx as a front end, with
nginx serving requests for static files and then proxying other
requests through to Apache/mod_wsgi. This is because nginx is arguably
better at serving static files and maintaining many open connections
with keep alive. The Apache/mod_wsgi instance would then only be
handling dynamic requests and all connections would come from local
nginx. Even if keep alive working there, depending on how optimised
nginx is, it can possibly reuse the connections over time for requests
from different originating clients in a more efficient way, thereby
keeping the memory overhead in Apache which generally arises from
maintaining open connections from lots of different clients.

Graham
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to