Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/299.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/django/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python uwsgi&x2B;django通过Nginx-uwsgi设置/繁殖?_Python_Django_Nginx_Wsgi_Uwsgi - Fatal编程技术网

Python uwsgi&x2B;django通过Nginx-uwsgi设置/繁殖?

Python uwsgi&x2B;django通过Nginx-uwsgi设置/繁殖?,python,django,nginx,wsgi,uwsgi,Python,Django,Nginx,Wsgi,Uwsgi,对于我的Django应用程序,我倾向于使用uwsgi+nginx,有人能分享启动我的uwsgi流程的最佳方法吗?有没有人有调试uwsgi的经验 在OSX上启动 Unice上的Upstart/init uwsgi也有自己的流程管理器,所以您也可以运行它 调整: 查看,以获取有关您的特定要求的建议。Uwsgi令人惊讶,它是一个完整的部署解决方案 默认情况下,0.8.40以上的Nginx将构建uwsgi绑定,构建Nginx,构建uwsgi,您就是golden。这些是我在fabfile.py文件中使用的

对于我的Django应用程序,我倾向于使用uwsgi+nginx,有人能分享启动我的uwsgi流程的最佳方法吗?有没有人有调试uwsgi的经验

在OSX上启动

Unice上的Upstart/init

uwsgi也有自己的流程管理器,所以您也可以运行它

调整:

查看,以获取有关您的特定要求的建议。Uwsgi令人惊讶,它是一个完整的部署解决方案


默认情况下,0.8.40以上的Nginx将构建uwsgi绑定,构建Nginx,构建uwsgi,您就是golden。

这些是我在fabfile.py文件中使用的函数(如果还没有,请查看python fabric):

在我的uwsgi.ini文件中,我指定:

[uwsgi]
socket = :{{your_port}}
master = true
vhost = true
no-site = true
processes = 1
enable-threads = true
pidfile = server.pid
daemonize = server.log
auto-procname = true
procname-prefix = servername_
对我来说,主要的哥特风格是:

  • 如果要在关闭终端/ssh会话后继续运行uwsgi服务器,请使用daemonise选项
  • 使用vhost在同一个uwsgi实例下运行多个站点,如果您的瓶颈是内存,这是非常好的,就像我使用其他出色的webparty主机一样
  • pidfile跟踪当前实例,使您能够调用uwsgi--stop-pidfile,uwsgi--start-pidfile
  • procname和procname prefix/append为您的进程提供了一个很好的名称,因此您可以使用ps-u username | grep some|u字符串轻松地将其选中

我将与supervisord一起管理启动和停止过程。

帮了我很多忙+1表示“procname”
[uwsgi]
socket = :{{your_port}}
master = true
vhost = true
no-site = true
processes = 1
enable-threads = true
pidfile = server.pid
daemonize = server.log
auto-procname = true
procname-prefix = servername_