1

I am using threading for socket connection to another machine in my django application hosted on apache mpm worker. the problem is apache creates many processes and django creates that many threads.

Basically i want it to make only one thread even if apache creates many processes.

is there any way i can stop django from making many threads.

4

2 に答える 2

1

これを行うためにWSGIを使用していると想定しています。構成ガイドには、

WSGIDaemonProcess example.com processes=2 threads=15

それは役に立つかもしれません。

于 2012-04-17T10:27:06.947 に答える
0

Django の場合は、フロントエンドとして WSGI (gunicorn/uwsgi) と nginx Web サーバーを使用することをお勧めします。

これを試してみてください http://senko.net/en/django-nginx-gunicorn/

それでも fastcgi で apache + django を使用したい場合は、FcgidMaxProcessesPerClass(DefaultMaxClassProcessCount)、FcgidMinProcessesPerClass(DefaultMinClassProcessCount)、FcgidMaxProcesses(MaxProcessCount)、FcgidMaxRequestsPerProcess( MaxRequestsPerProcess) を 1 - mod_fcgid(apache2) に設定してみてください。mod_python がどのように機能するかはわかりませんが、使用するのは得策ではないと思います。

于 2012-04-17T21:24:53.730 に答える