通用linux接口服务器参数调优
2015-11-06 08:51
507 查看
1. 如果需要支撑百万级同时在线数,需要对linux默认内核参数进行调整,我们的典型配置是在 /etc/sysctl.conf增加以下内容: net.ipv4.tcp_max_orphans = 262144 net.ipv4.tcp_no_metrics_save=1 net.ipv4.tcp_window_scaling = 0 net.ipv4.tcp_max_syn_backlog = 120000 net.core.netdev_max_backlog = 120000 net.core.somaxconn = 12000 net.ipv4.tcp_fin_timeout = 10 net.ipv4.tcp_tw_reuse = 1 net.ipv4.tcp_tw_recycle = 1 net.ipv4.tcp_max_tw_buckets = 1000 net.ipv4.tcp_abort_on_overflow = 1 net.ipv4.tcp_sack = 0 net.ipv4.tcp_rmem = 4096 8192 32768 net.ipv4.tcp_wmem = 4096 8192 32768 net.ipv4.tcp_timestamps = 0 net.ipv4.tcp_mem = 3075840 4101120 12303360 net.ipv4.tcp_keepalive_time = 30 net.ipv4.tcp_keepalive_probes = 5 net.ipv4.tcp_keepalive_intvl = 15 net.ipv4.tcp_synack_retries = 2 net.ipv4.tcp_syn_retries = 2 net.core.rmem_max=16777216 net.core.wmem_max=16777216 net.ipv4.ip_local_port_range = 1024 65535 net.ipv4.tcp_syncookies = 0 修改/etc/security/limits.conf配置: * soft nofile 1200000 * hard nofile 1200000部分ubuntu系统需要这么修改
root hard nofile 1000000 root soft nofile 1000000 root soft core unlimited root soft stack 10240 ubuntu hard nofile 1000000 ubuntu soft nofile 1000000 ubuntu soft core unlimited ubuntu soft stack 10240 * hard nofile 1000000 * soft nofile 1000000
相关文章推荐
- Linux 中的静态库和动态库简介及生成过程示例
- 如何在 Antergos/Arch Linux 中使用 iPhone
- CentOS 6.7 FTP安装配置之pure-ftpd
- 2015年第三季度46%的DDoS攻击都来自Linux计算机
- Linux安装sbt过程详解
- linux下 open fopen区别
- VMWare安装CentOS图文教程
- Linux_KVM虚拟机
- Linux下查看文件和文件夹大小
- 如何在给快满的Linux分区"无伤"扩容
- Linux进程间套接字(Socket)通信
- linux:服务
- Linux命令每天必学(55)之traceroute命令
- ubuntu 无线网速很慢
- ubuntu 开机执行脚本
- linux下安装jdk
- Linux下安装nodejs并创建express框架环境
- linux下安装yum命令安装lamp环境
- tar命令解压.zip文件出错:gzip: stdin has more than one entry--rest ignored
- 大学校园内使用桥接方式上网的虚拟机Linux无法ping通外网的原因