2010-07-07 146 views

回答

4

在OSX上啓動

unst上的Upstart/init。

uwsgi也有自己的進程管理器,所以你也可以運行它。

調整:

檢查mailing list,在您的特殊要求的建議。 Uwsgi很棒,它是一個完整的部署解決方案。

Nginx高於0.8.40將默認生成uwsgi綁定,生成nginx,生成uwsgi並且你是黃金。

1

這些都是我在fabfile.py文件使用的功能(看看蟒蛇面料,如果您還沒有):

def start_uwsgi(): 
    with cd(env.server.uwsgi): 
     if(exists('server.pid')): 
      stop_uwsgi() 
      run('sleep 1') 
     run('source venv/bin/activate;uwsgi --ini uwsgi.ini;')) 

def stop_uwsgi(): 
    with cd(env.server.uwsgi): 
     if(exists('server.pid')): 
      run('source venv/bin/activate;uwsgi --stop server.pid;')) 

在我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_ 

對我來說,主要是gotyas:

  • 使用daemonise選項,如果你想保持uwsgi服務器去你閉上你的終端/ SSH年代後分裂國家
  • 使用虛擬主機相同的uwsgi實例,這是偉大的,如果你的瓶頸是內存,像我是與其它的夢幻般的webfaction主機
  • 跟蹤了pidfile當前實例,使您能夠調用uwsgi下運行多個站點 - 停止pidfile,uwsgi --start pidfile
  • procname和procname-prefix/append爲您的進程提供一個不錯的名稱,以便您可以輕鬆地使用ps -u username | grep some_string
+0

幫了我很多! +1爲「procname」 – 2012-04-27 14:25:46

0

我將與supervisord一起管理啓動,停止過程。