zoukankan      html  css  js  c++  java
  • django uwsgi

    uwsgi.ini

    [uwsgi]
    socket =/data/projects/rookie/script/uwsgi.sock
    # django project root path
    chdir = /data/projects/rookie
    # wsgi path
    wsgi-file = rookie/wsgi.py
    module=rookie.wsgi:application
    processes = 4
    threads = 2
    stats = 192.168.110.151:8002
    # if service stopped auto removed unix socket and pid file
    vacuum = true
    # uwsgi log path
    #daemonize = uwsgi.log
    # mean only record error log and not record normal log
    disable-logging = true
    # run service with which user and group of linux
    uid = root
    gid = root
    # uwsgi.pid path and  default uwsgi.ini same dir
    pidfile=uwsgi.pid
    # the buffer-size limit max size
    buffer-size = 65536
    # max requests amount
    max-requests=5000
    # queue-size of listen
    listen= 200
    # limit uwsgi progress virtual mem  usage size is 6048M
    limit-as =6048
    env = LANG=en_US.UTF-8
    # venv path
    home=/usr/local/bin/venv
    # drop request and recycle progress of request after 60 seconds not response
    harakiri = 60
    

     

    nginx.conf

    worker_processes  1;
    
    
    
    
    events {
        worker_connections  1024;
    }
    
    
    http {
        include       mime.types;
        default_type  application/octet-stream;
    
    
    
        sendfile        on;
    
        keepalive_timeout  65;
    
    
        server {
            listen       80;
            server_name  192.168.110.151;
    
    
    
            location / {
                root /data/projects/rookie;
                uwsgi_pass unix:/data/projects/rookie/script/uwsgi.sock
    
    ;
                include uwsgi_params;
            }
            location /static {
               alias /data/projects/rookie/static;
    	}
    
    
            error_page   500 502 503 504  /50x.html;
            location = /50x.html {
                root   html;
            }
    
    
    
        }
    
    
    
    
    
    
    
    
    
    
    }
    

     

    参考文章:

    https://uwsgi-docs.readthedocs.io/en/latest/Nginx.html

    https://docs.djangoproject.com/zh-hans/3.0/howto/deployment/wsgi/uwsgi/

  • 相关阅读:
    五个问题,三大策略,手把手教你定制App性能监控方案
    Oracle外部表详解 转
    EBS 一揽子采购协议 转载
    xsl特殊符号输出总结 转
    设计模式目录
    控制CPU使用率,让它画一条弧线
    C# 俄罗斯方块
    程序员能力矩阵
    如何在IIS上搭建WAP网站
    利用SQL2005的row_number()重新写了个自定义分页存储过程
  • 原文地址:https://www.cnblogs.com/SunshineKimi/p/14551866.html
Copyright © 2011-2022 走看看