On Jul 22, 9:34 pm, Le Roux Bodenstein <lero...@gmail.com> wrote:
> > If it is to bring down application for maintenance, seems like it
> > would be easier to use Apache/mod_wsgi in daemon mode.
>
> I'll give mod_wsgi a go. To be honest I never looked at it before
> simply because it is tied to apache. But if it can easily do
> everything I need using a reasonable amount of memory and provide
> decent performance, then I'll allow it ;)
>
> My app pre-dates mod_wsgi and at the time mod_python just seemed too
> bloated.

There is a lot of myth to that. Although older versions of mod_python
had some memory leaks, that has in the main been addressed. The
problems with memory bloat were Python installations with no shared
library for Python and bad configuration of Apache. For a bit of a
discussion see:

  http://blog.dscpl.com.au/2009/03/load-spikes-and-excessive-memory-usage.html

> I've never been an apache fan and memory usage is/was my main
> concern which is why I leaned towards lighttpd. At the time I felt
> that it performed better with serving up static files, but I haven't
> actually benchmarked it in ages. I suppose you can run lighttpd/nginx
> in front of apache,

And I would also suggest you run nginx in front. It is good at static
file serving and also because of the way it handles proxying, isolates
Apache from slow clients. This means that Apache is being used for as
little time as possible as nginx will act as a buffer and handle the
talking to the slow client. You therefore get optimal use of Apache
resources, much better than if Apache was the front facing web server
and was handling both static and dynamic requests. Behind nginx,
Apache doesn't have to worry about keep alive either.

> but all apache is really doing by then is act as a
> proxy that converts http into something mod_wsgi daemons understand
> which just feels terribly bloated to me..

How much memory a Python application takes up is not really going to
vary whatever mechanism you use. So, if you run a multiprocess
configuration with 5 process, be it with mod_wsgi daemon mode, flup or
mod_proxy load balanced, that is still 5 times whatever amount of
memory your application requires. There is nothing about Apache that
suddenly means your application needs twice as much memory or
otherwise bloats out more than it would with other mechanisms. There
is a lot of FUD and misunderstanding around using Python with Apache,
it is not as evil as some would like to portray, you just need to
configure it properly and understand how it works to make best use of
it.

Overall, the only difference should be the minimal amount of memory
Apache itself adds to each process, but in the context of your typical
fat Python web application that is small enough to be neglible.

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