我成功设法安装: 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” –