Nginx代理服务内核优化

# Kernel sysctl configuration file for Red Hat Linux
#
# For binary values, 0 is disabled, 1 is enabled. See sysctl(8) and
# sysctl.conf(5) for more details. # Controls IP packet forwarding
net.ipv4.ip_forward = 0 # Controls source route verification
net.ipv4.conf.default.rp_filter = 1 # Do not accept source routing
net.ipv4.conf.default.accept_source_route = 0 # Controls the System Request debugging functionality of the kernel
kernel.sysrq = 0 # Controls whether core dumps will append the PID to the core filename.
# Useful for debugging multi-threaded applications.
kernel.core_uses_pid = 1 # Controls the use of TCP syncookies
net.ipv4.tcp_syncookies = 1 # Disable netfilter on bridges.
net.bridge.bridge-nf-call-ip6tables = 0
net.bridge.bridge-nf-call-iptables = 0
net.bridge.bridge-nf-call-arptables = 0 # Controls the default maxmimum size of a mesage queue
kernel.msgmnb = 65536 # Controls the maximum size of a message, in bytes
kernel.msgmax = 65536 # Controls the maximum shared segment size, in bytes
kernel.shmmax = 68719476736 # Controls the maximum number of shared memory segments, in pages
kernel.shmall = 4294967296
########################################
# set sysctl.conf
net.ipv4.tcp_max_syn_backlog = 65536
net.core.netdev_max_backlog = 32768
net.core.somaxconn = 32768
net.core.wmem_default = 8388608
net.core.rmem_default = 8388608
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
net.ipv4.tcp_timestamps = 0
net.ipv4.tcp_synack_retries = 2
net.ipv4.tcp_syn_retries = 2
net.ipv4.tcp_tw_recycle = 0
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_mem = 94500000 915000000 927000000
net.ipv4.tcp_max_orphans = 3276800
net.ipv4.tcp_fin_timeout = 5
net.ipv4.tcp_keepalive_time = 120
net.ipv4.tcp_orphan_retries = 1
net.ipv4.tcp_keepalive_intvl = 15
net.ipv4.tcp_keepalive_probes = 4
net.ipv4.tcp_max_tw_buckets = 1800000
net.netfilter.nf_conntrack_max = 655350
net.netfilter.nf_conntrack_tcp_timeout_established = 1200
net.ipv4.tcp_rmem = 4096 87380 16777216
net.ipv4.tcp_wmem = 4096 65536 16777216
net.ipv4.ip_local_port_range = 1024 65000
net.ipv4.tcp_window_scaling = 1
net.ipv4.tcp_sack =1
kernel.pid_max = 65536
net.ipv4.inet_peer_gc_mintime = 10
net.ipv4.ipfrag_time = 30
vm.vfs_cache_pressure = 150
kernel.shmmni = 4096
vm.min_free_kbytes = 204800
vm.dirty_expire_centisecs = 1500
vm.dirty_writeback_centisecs = 200
vm.dirty_ratio = 20
vm.dirty_background_ratio = 10
vm.swappiness = 5
########################################

Nginx Web服务内核优化

#fs.file-max = 102400
vm.swappiness = 0
#net.nf_conntrack_max = 655360
net.netfilter.nf_conntrack_tcp_timeout_established = 1200
net.ipv4.tcp_synack_retries = 2
net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_tw_recycle = 0
#net.ipv4.tcp_tw_reuse = 1
#net.ipv4.tcp_timestamps = 0
#net.ipv4.tcp_max_syn_backlog = 200000
#net.ipv4.tcp_max_tw_buckets = 5000
net.ipv4.tcp_sack = 1
net.ipv4.tcp_window_scaling = 1
net.ipv4.tcp_rmem = 4096 87380 4194304
net.ipv4.tcp_wmem = 4096 16384 4194304
net.ipv4.tcp_mem = 94500000 915000000 927000000
net.ipv4.tcp_max_orphans = 3276800
net.ipv4.tcp_syn_retries = 1
#net.ipv4.tcp_fin_timeout = 1
net.ipv4.ip_local_port_range = 1024 65535
net.core.wmem_default = 8388608
net.core.rmem_default = 8388608
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
net.core.netdev_max_backlog = 262144
#net.core.somaxconn = 262144
#net.ipv4.tcp_keepalive_time = 1200

Sysctl.conf

# Kernel sysctl configuration file for Red Hat Linux
#
# For binary values, 0 is disabled, 1 is enabled. See sysctl(8) and
# sysctl.conf(5) for more details. # Controls IP packet forwarding
#net.ipv4.ip_forward = 0 # Controls source route verification
#net.ipv4.conf.default.rp_filter = 1 # Do not accept source routing
#net.ipv4.conf.default.accept_source_route = 0 # Controls the System Request debugging functionality of the kernel
#kernel.sysrq = 0 # Controls whether core dumps will append the PID to the core filename
# Useful for debugging multi-threaded applications
#kernel.core_uses_pid = 1 # Controls the use of TCP syncookies
#net.ipv4.tcp_syncookies = 1 # Controls the maximum size of a message, in bytes
#kernel.msgmnb = 65536 # Controls the default maxmimum size of a mesage queue
#kernel.msgmax = 65536 # Controls the maximum shared segment size, in bytes
#kernel.shmmax = 68719476736 # Controls the maximum number of shared memory segments, in pages
#kernel.shmall = 4294967296 net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
kernel.threads-max=65535
kernel.msgmni = 16384
kernel.msgmnb = 65535
kernel.msgmax = 65535
kernel.shmmax = 68719476736
kernel.shmall = 4294967296
kernel.shmmni = 4096
kernel.sem = 5010 641280 5010 128
net.ipv4.tcp_max_tw_buckets = 20000
net.ipv4.tcp_sack = 1
net.ipv4.tcp_window_scaling = 1
net.ipv4.tcp_rmem = 4096 87380 16777216
net.ipv4.tcp_wmem = 4096 65536 16777216
net.core.wmem_default = 8388608
net.core.rmem_default = 8388608
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
net.core.netdev_max_backlog = 32768
net.ipv4.tcp_no_metrics_save = 1
net.core.somaxconn = 32768
net.core.optmem_max = 10000000
net.ipv4.tcp_max_orphans = 32768
net.ipv4.tcp_max_syn_backlog = 32768
net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_timestamps = 0
net.ipv4.tcp_synack_retries = 2
net.ipv4.tcp_syn_retries = 2
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_mem = 94500000 915000000 927000000
net.ipv4.tcp_fin_timeout = 10
net.ipv4.tcp_keepalive_time = 300
net.ipv4.tcp_keepalive_probes=10
net.ipv4.tcp_keepalive_intvl=2
net.ipv4.ip_local_port_range = 10000 65535
net.ipv4.route.gc_timeout = 100
net.ipv4.tcp_congestion_control=cubic
net.ipv4.conf.lo.arp_ignore = 1
net.ipv4.conf.lo.arp_announce = 2
net.ipv4.conf.all.arp_ignore = 1
net.ipv4.conf.all.arp_announce = 2
fs.aio-max-nr = 1024000
fs.file-max = 1024000
vm.swappiness = 0

Linux内核优化(未注释)的更多相关文章

  1. Tomcat调优总结(Tomcat自身优化、Linux内核优化、JVM优化)

    Tomcat自身的调优是针对conf/server.xml中的几个参数的调优设置.首先是对这几个参数的含义要有深刻而清楚的理解.以tomcat8.5为例,讲解参数. 同时也得认识到一点,tomcat调 ...

  2. 第三次阅读赵炯博士的《linux内核代码完全注释》:序

    这是我第三次阅读linux内核代码完全注释了,当然前两次也没有读完,第一次读到第五章,第二次第七章. 所以说,赵炯博士对我最大的帮助时介绍了intel386的结构,以及内核编程的方法. 至于真正的内核 ...

  3. 通用Linux内核优化配置

    通用Linux内核优化配置 针对CentOS6.CentOS7.Redhat6.Redhat7等系统 net.ipv4.ip_forward = net.ipv4.conf. net.ipv4.con ...

  4. Linux 内核优化

    声明:本文档来自互联网整理部份加自已实验部份所得: TCP 相关部份   经常使用名词说明: retries(再试).   TCP server <---> client通信状态      ...

  5. Linux内核优化

     相信做运维的同仁,进行运维环境初建时,必须要考虑到操作系统内核参数的优化问题,本人经历数次的运维环境重建后,决定要自行收集一份比较完善的系统内核参数优化说明文件出来,于是就有了下文,本文当前值是官方 ...

  6. 基于Nginx实现10万+并发,你应该做的Linux内核优化

    由于默认的linux内核参数考虑的是最通用场景,这明显不符合用于支持高并发访问的Web服务器的定义,所以需要修改Linux内核参数,是的Nginx可以拥有更高的性能: 在优化内核时,可以做的事情很多, ...

  7. Nginx 服务并发过10万的Linux内核优化配置

    以下Linux 系统内核优化配置均经在线业务系统测试,服务器运行状态良好,用了一些时间整理,现和大家分享一下,如有那位高人看到配置上有问题,请给与指出! # Controls the use of T ...

  8. Nginx优化指南+LINUX内核优化+linux连接数优化+nginx连接数优化

    Most setup guides for Nginx tell you the basics - apt-get a package, modify a few lines here and the ...

  9. 【转】Nginx服务并发过10万的Linux内核优化配置

    http://www.linuxidc.com/Linux/2012-11/75151.htm以下Linux 系统内核优化配置均经在线业务系统测试,服务器运行状态良好,用了一些时间整理,现和大家分享一 ...

随机推荐

  1. [sql]SET NOCOUNT ON 的作用

    使返回的结果中不包含有关受 Transact-SQL 语句影响的行数的信息. 说明: 场景1:(不使用SET NOCOUNT) 场景2:(使用SET NOCOUNT ON ) 场景3:(使用SET N ...

  2. 谈谈WPF中的CollectionView与CollectionViewSource

    https://www.cnblogs.com/zhouyinhui/archive/2007/12/07/987076.html

  3. Linux 下升级JDK 1.7到1.8

    1.下载1.8的jdk rpm文件到linux系统 2.执行rpm -ivh jdk-8u151-linux-x64.rpm 选项详解: -a:查询所有套件: -b<完成阶段><套件 ...

  4. IOS-网络(小文件下载)

    // // ViewController.m // IOS_0131_小文件下载 // // Created by ma c on 16/1/31. // Copyright © 2016年 博文科技 ...

  5. npm设置仓库

    如果国外官方的npm仓库下载速度很慢的话,可以考虑更换npm仓库,加快下载包的速度. 1.通过config命令 npm config set registry https://registry.npm ...

  6. css之grid layout代码解释

    .wrapper { display: grid; grid-template-columns: repeat(3, 1fr);/*grid-template-columns CSS属性定义了网格列的 ...

  7. java生成doc和jar

    生成doc帮助文档. 第一步,需要有一个java类,里面封装了各种方法 第二部,给类和方法添加注释文档 注释文档格式: /** * */ @author 作者 @version 版本 @return ...

  8. ASP.NET FORM认证配置排错记录

    搞了2小时都不能实现自动跳转到登录页面,后删除了配置文件中的name,就解决问题了. <authorization>      <deny users="?" / ...

  9. [置顶] Unity2d引入新功能SpriteAtlas,Sprite新的图集方式

    孙广东  2017.8.3 http://blog.csdn.NET/u010019717 在Unity 2017.1.0f3中引入了 SpriteAtlas 官方文档:  https://docs. ...

  10. swift 触摸与手势

    class MyView: UIView { var lView:UIView! var time:NSTimer! override init(frame: CGRect) { super.init ...