我成功設法安裝: NGINX +一個CentOS 6.x的服務器的Python:爲NGINX + FLASK uWSGI配置
,但我仍然在配置方面有些疑惑的uWSGI +瓶 :
1)我正在運行NGINX作爲服務:如果我輸入「ps aux | grep nginx」,我可以看到2個進程:
-/nginx -c /etc/nginx/nginx.conf
- (用戶nginx)工作進程
是嗎?
2)我爲Flask設置了virtualenv,並在這樣的virtualenv下安裝了uWSGI包。
chdir = /myappdir
uid = pyuser
chmod-socket = 666
socket = /tmp/uwsgi.sock
module = run
callable = app
virtualenv = /myappdir/myvirtualenv
是否有可能開始uWSGI作爲一種服務,類似於NGINX(:
Currenty我通過鍵入「uwsgi /somedir/uwsgi.ini」,其中uwsgi.ini如下手動啓動uWSGI如點1)所述?這種情況下,用戶應該是root還是非root?
3)當我開始uWSGI,我目前得到以下警告:
*** Python threads support is disabled. You can enable it with --enable-threads ***
我意識到「uwsgi.ini」配置文件中,還可以配置一些進程和線程。考慮到我運行的服務器只有1個內核,我可以設置多個進程和線程嗎?如果是這樣,多少?
3b)在NGINX配置文件「/etc/nginx/nginx.conf」中,還可以指定「worker_processes」,默認值爲1.我可以增加它,還是可以高於1對於多核服務器?
4)除了禁用線程支持,當我啓動uWSGI時,我也會得到這些警告。他們的意思是什麼?
*** WARNING: you are running uWSGI without its master process manager ***
*** Operational MODE: single process ***
*** uWSGI is running in multiple interpreter mode ***
我把它安裝在virtualenv上,用「pip install uwsgi」 –