django 多進程 —— uwsgi

django多進程uwsgi 流程

  • 1、安裝uwsgi
pip install uwsgi
  • 2、配置啓動文件(eg: uwsgi.ini)
[uwsgi]
http= 0.0.0.0:8889

# socket = 127.0.0.1:8001

# the base directory (full path)
chdir = /home/hilqiqi0/images_manger

# Django's wsgi file
wsgi-file = images_manage/wsgi.py

# maximum number of worker processes
processes = 8

#thread numbers startched in each worker process
threads = 2

#monitor uwsgi statu
stats = 127.0.0.1:9191


# clear environment on exit
vacuum          = true

#
daemonize = /home/hilqiqi0/images_manger/uwsgi.log
  • 3、啓動uwsgi
uwsgi uwsgi.ini
  • 4、關閉所有uwsgi啓動的進程
pkill -f uwsgi -9
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章