On Aug 11, 3:11 am, Jumpfroggy <rocketmonk...@gmail.com> wrote:
> Wow, lots of good feedback here.  Thanks!
>
> On Aug 9, 6:17 pm, Graham Dumpleton <graham.dumple...@gmail.com>
> wrote:
>
> > Replace use of mod_python with mod_wsgi.
>
> I'm using mod_wsgi for everything already, forgot to say.  When I
> researched, it seemed like the newer/better way to do django.
>
> > Ensure you use prefork MPM
> > for Apache and delegate Django instances to run in mod_wsgi daemon
> > mode process.
> > Sorry, meant to say 'worker' rather than 'prefork'. DO NOT USE
> > PREFORK. Hmmm, that was a bad stuff up. :-)
>
> I just started using the worker MPM for one of my apps.  It didn't
> seem to give any performance or memory savings, since my app is so
> small/simple.  I'll keep an eye on it for later.

In WebFaction model possibly wouldn't as you tend to be running as
much as possible in single process anyway to keep within your memory
limits.

> Using daemon mode gives me auto-reloading by touching the .wsgi file
> (yay), but it uses more memory.  Instead of supervisor (3MB) and
> apache worker/WSGI/Django (16MB) processes, now I have supervisor
> (3MB), apache worker (3MB), and wsgi/django (15MB).  Not a huge gain,
> but just a bit more.  I'm willing to live with that for the auto-
> reloading benefit, however.

Why do you still need supervisor. Certainly not required for mod_wsgi.
Am a bit confused.

> > Having done that, you can use inactivity-timeout option
> > for mod_wsgi daemon processes to have the process restarted and
> > returned to low memory footprint idle process after no use for a
> > while.
>
> This is exactly what I wanted!!!  It's funny how when I finally read
> the description for something, it matches exactly what I'm looking
> for.  I just didn't know where to look.  I just tried it, and yes my
> memory baloons up to 16MB, then comes back down later.  The only
> strange thing is that I set it to 10s (very short) to test out, but it
> takes a while for the process to actually be reclaimed.  If I put
> inactivity-timeout=10, then load the page, then close the browser,
> memory usage should be reclaimed in 10 seconds, right?  It seems more
> like 1 minute wait, which is fine but strange to me.  Maybe there's
> only polling at certain intervals (checks every 1 minute), so the
> resolution isn't that fine.  Maybe it's dependent on the deadlock
> timeout?  Don't know.

Nothing to do with deadlock timeout. You should be able to set values
less than 1 minute. I wouldn't recommend to short a timeout though as
requests by same user within a browsing session are often reasonable
time apart. If too short a timeout, then Django gets kicked out
between requests and has to be reloaded every time, which would give
CGI like performance.

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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to