2

Developing in Python using mod-python mod-wsgi on Apache 2.

All running fine, but if I do any change on my PY file, the changes are not propagated until I restart Apache /etc/init.d/apache2 restart.

This is annoying since I can't SSH and restart Apache service everytime in development.

Is there any way to disable Apache caching?

Thank you.

4

2 に答える 2

4

パフォーマンスの観点からは非常に悪い設定ですが、http.conf で行うことはMaxRequestsPerChild1 に設定されています。これにより、各 apache プロセスが停止する前に単一の要求を処理するという効果があります。これはスループットを低下させます (そのため、その設定でベンチマークを実行したり、実稼働サイトで使用したりしないでください)、すべての要求に対して Python にクリーンな環境を与える効果があります。

于 2012-09-14T21:31:06.927 に答える
2

mod_wsgiを使用している場合は、WSGIScriptReloadingディレクティブを使用してtouch your.wsgiコマンドを発行し、WSGIにインタープリタープロセスをリロードさせることができます。

于 2012-09-14T21:42:12.787 に答える