• autocare使用命令


    Linux

    查看目录占用大小
    du -h --max-depth=1

    du -sh *
    删除当前目录所有文件
    rm -rf *

    可以用下面的命令将 cpu 占用率高的线程找出来:
    ps H -eo user,pid,ppid,tid,time,%cpu,cmd --sort=%cpu
    free -th
    Mem:表示物理内存统计
    -/+ buffers/cached:表示物理内存的缓存统计

    MySQL

    log_queries_not_using_indexes ==> ON 未走索引的语句以及相关情况均会被记录在慢查询日志当中

    long_query_time ==> 1s 执行时间较长的语句也会被记录在慢查询日志

    gunicorn独角兽

    (mysite) [root@instance-xu9puhyr ProjectCRM]# pstree -ap|grep gunicorn

    (mysite) [root@instance-xu9puhyr ProjectCRM]# kill -9 进程号

    重启 :kill -HUP 进程号

    ===================================================================

    FLASK需要创建gunicorn配置文件,命名:gunicorn.conf

    # 并行工作线程数
    workers = 4
    # 监听内网端口5000【按需要更改】
    bind = '0.0.0.0:8009'
    # 设置守护进程【关闭连接时,程序仍在运行】
    daemon = True
    # 设置超时时间120s,默认为30s。按自己的需求进行设置
    timeout = 120
    # 设置访问日志和错误信息日志路径
    # accesslog = './logs/acess.log'
    # errorlog = './logs/error.log'

    gunicorn 运行模块名:应用名 -c 配置文件  线上flask启动命令  gunicorn Online_Promotion:app -c gunicorn.conf

    gunicorn service:app -c gunicorn.conf

     

  • 相关阅读:
    [LeetCode] Two Sum
    INTERESTING AND OBSCURE INHERITANCE ISSUES WITH CPP
    Changing the Overridden Method’s Characteristics
    Cpp多重继承会产生的问题
    [LeetCode] Copy List with Random Pointer
    [LeetCode] Merge k Sorted Lists
    [LeetCode] Swap Nodes in Pairs
    [LeetCode] Add Two Numbers
    [LeetCode] Merge Two Sorted Lists
    [LeetCode] Climbing Stairs (Sequence DP)
  • 原文地址:https://www.cnblogs.com/lee-xingxing/p/10958547.html
Copyright © 2020-2023  润新知