On Jan 17, 3:44 am, AlK <[email protected]> wrote:
> Hi !
>
> I developed a small Website querying some other sites in background
> like a "cron". The queries are handled in a separate thread that I can
> start and stop when I want from a simple web-interface. It works great
> on my development environment, when I launch the website using the
> "python manage.py runserver" command.
>
> But when I put the site on a production environment, using mod_wsgi
> (or mod_python) following the steps described on Django's website, it
> appears that the website is launched each time a user is querying it,
> so the thread does not persist between them.

Likely because you are running it in a multiprocess configuration.
Read:

  http://code.google.com/p/modwsgi/wiki/ProcessesAndThreading
  http://blog.dscpl.com.au/2009/03/load-spikes-and-excessive-memory-usage.html

For mod_wsgi, use daemon mode.

> So I managed to run the site with a reverse proxy handled by Apache
> with mod_proxy ( here is my config file if you are 
> interestedhttp://dpaste.com/hold/146080/). I simply run the django's 
> integrated
> server on the port 8000 and it works as expected.
>
> I need your point of view of that approach of the problem : is it good
> enough for a production website ? (fast, stable etc...) My website is
> not intended to a large public, but I am curious about that, and - if
> this is a viable solution -, why not document it as an alternative of
> the other deployment solutions ?

The Django development server is not recommended for production
systems.

Graham
-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected].
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