Search code examples
djangowebservercherokee

cherokee doesn't synchronic update django process code


I use cherokee(1.0) as web server and django web framework(1.2.1).

When I update django files like views.py or static files, web server seems not to update instantly. I guess it is about cache, so i set expiration "already expired on 1970", but the problem remains.

I also try to restart server in admin website, but still can't solve the problem.

how can it update synchronicly or can I update it by myself?


Solution

  • Try to kill all fcgi processes. ps -ef | grep fcgi|awk '{print $2}'|xargs sudo kill -9

    ===================================

    I asked cherokee project and get response below:

    Comment 1 by hcarvalhoalves, Yesterday (30 hours ago) This happens because the request is still being served by an old FastCGI process. After code changes, you don't have to restart Cherokee, but instead restart the FastCGI process. For that, you can start django passing the PID file parameter (configure this under Sources):

    ./manage runfcgi ... pidfile=/var/run/django-fcgi.pid

    Then later, when you change code, restart the fcgi process with:

    kill -HUP `cat /var/run/django-fcgi.pid

    Not a bug on Cherokee at all, as it doesn't touch any python files, just serves thru FCGI.