zoukankan      html  css  js  c++  java
  • 高负载linux调优

    调整Linux内核参数:

    # vi /etc/sysctl.conf
    # tells the Kernel it's ok if services bind to non-existant IP ADDR
    # net.ipv4.ip_nonlocal_bind = 1
    # defines the size of the kernel queue for accepting new connections, Defaults to 128
    net.core.somaxconn = 40000
    # Maximum number of remembered connection requests, Defaults to 1024
    net.ipv4.tcp_max_syn_backlog = 40000
    # Tuning TCP Ports, increase the range to allow for more connections. 
    # The number of avaliable ports limits the number of simultanious open connections.
    net.ipv4.ip_local_port_range = 1024 65535
    # Tell kernel to reuse faster the connection in TIME_WAIT
    net.ipv4.tcp_tw_reuse = 1
    net.ipv4.tcp_tw_recycle = 1
    # Resetting the File Descriptors, the maximum number of open files allowed per process
    fs.file-max = 1000000
    使设置生效:
    # sysctl -p
    调整最大打开文件描述符限制
    调整文件描述符限制:
    # ulimit -n 1000000
    # vi /etc/security/limits.conf
    # Setting Shell Limits for File Descriptors
    * soft nofile 1000000
    * hard nofile 1000000
    使用PAM模块限制资源:
    # vi /etc/pam.d/login
    session required pam_limits.so 

  • 相关阅读:
    css兼容性大坑
    JS获取元素CSS值
    calendar的一些操作
    java日期工具类
    redis的一些操作
    webstorm ES6 转 ES5
    基于时间的动画算法
    3434
    MySQL登陆知识
    MySQL密码知识点
  • 原文地址:https://www.cnblogs.com/Ph-one/p/6481494.html
Copyright © 2011-2022 走看看