zoukankan      html  css  js  c++  java
  • gunicorn 调试功能

    dash-gun.py


    accesslog = "./log/dash_acess.log" # 请求 errorlog = './log/dash_error.log'  # 错误 loglevel = 'debug'            # debug 模式 reload = True               # 修改代码自动重启

    运行(我运行的是flask)

    gunicorn --config dash-gun.py -b 0.0.0.0:5555 'app:public()'

    这样在控制台会输出一些 print 信息

    在 dash_error.log 中可以看到一些请求和报错

    在 dash_acess.log 中是详细的请求

    可以使用 tail 命令动态查看

    tail -10f dash_error.log

    贴一个完整的配置:

    dash-run-test.sh # 运行文件

    #!/bin/sh
    # 进入虚拟环境
    source /www/wwwroot/default/env/bin/activate
    
    # export FLASK_APP=app:dash
    # flask run -p 5558
    
    #gunicorn --log-level=info -b 0.0.0.0:5558 'app:dash()'
    gunicorn 'app:dash()' -c config/gunicorn/dash-gunicorn-test.py
    

     配置文件:

    #workers=8 # 进程数
    #threads = 2 # 工作者的线程数
    bind = '0.0.0.0:5560'
    daemon = 'false' # 使用suppervisor 管理  暂时使用nohup
    worker_class = "gevent" # 并发
    worker_connections = 2000
    threads = 20
    #pidfile = '/var/run/gunicorn.pid' # 设置进程文件目录
    accesslog = './log/gunicorn/gun_dash_acess.log'
    errorlog = './log/gunicorn/gun_dash_error.log'
    # 设置日志记录水平
    loglevel = 'warning'
    timeout = 6000
    #preload_app = True
    reload = True
    

      

  • 相关阅读:
    css变量
    es6的this指向
    Java面试题(包装类)
    moment笔记
    Class
    CSS斜切角
    Element.getBoundingClientRect()
    Do not mutate vuex store state outside mutation handlers.
    antd不想写那么多option怎么办
    解析URL参数
  • 原文地址:https://www.cnblogs.com/ShanCe/p/14306851.html
Copyright © 2011-2022 走看看