Linux内核优化(未注释)
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内核优化(未注释)的更多相关文章
- Tomcat调优总结(Tomcat自身优化、Linux内核优化、JVM优化)
Tomcat自身的调优是针对conf/server.xml中的几个参数的调优设置.首先是对这几个参数的含义要有深刻而清楚的理解.以tomcat8.5为例,讲解参数. 同时也得认识到一点,tomcat调 ...
- 第三次阅读赵炯博士的《linux内核代码完全注释》:序
这是我第三次阅读linux内核代码完全注释了,当然前两次也没有读完,第一次读到第五章,第二次第七章. 所以说,赵炯博士对我最大的帮助时介绍了intel386的结构,以及内核编程的方法. 至于真正的内核 ...
- 通用Linux内核优化配置
通用Linux内核优化配置 针对CentOS6.CentOS7.Redhat6.Redhat7等系统 net.ipv4.ip_forward = net.ipv4.conf. net.ipv4.con ...
- Linux 内核优化
声明:本文档来自互联网整理部份加自已实验部份所得: TCP 相关部份 经常使用名词说明: retries(再试). TCP server <---> client通信状态 ...
- Linux内核优化
相信做运维的同仁,进行运维环境初建时,必须要考虑到操作系统内核参数的优化问题,本人经历数次的运维环境重建后,决定要自行收集一份比较完善的系统内核参数优化说明文件出来,于是就有了下文,本文当前值是官方 ...
- 基于Nginx实现10万+并发,你应该做的Linux内核优化
由于默认的linux内核参数考虑的是最通用场景,这明显不符合用于支持高并发访问的Web服务器的定义,所以需要修改Linux内核参数,是的Nginx可以拥有更高的性能: 在优化内核时,可以做的事情很多, ...
- Nginx 服务并发过10万的Linux内核优化配置
以下Linux 系统内核优化配置均经在线业务系统测试,服务器运行状态良好,用了一些时间整理,现和大家分享一下,如有那位高人看到配置上有问题,请给与指出! # Controls the use of T ...
- Nginx优化指南+LINUX内核优化+linux连接数优化+nginx连接数优化
Most setup guides for Nginx tell you the basics - apt-get a package, modify a few lines here and the ...
- 【转】Nginx服务并发过10万的Linux内核优化配置
http://www.linuxidc.com/Linux/2012-11/75151.htm以下Linux 系统内核优化配置均经在线业务系统测试,服务器运行状态良好,用了一些时间整理,现和大家分享一 ...
随机推荐
- RoR unobtrusive scripting adapter--UJS(一些Javascript的语法糖)
Learn how the new Rails UJS library works and compares with the old version of jquery_ujs that it re ...
- poj1459网络流之多源点最大流
这题想了好久,一直认为应该bfs更新后求最小值把发电站最大发电加进去,但是又发现这样求增广路的时候会导致用户更新出错, 加源点和汇点也考虑到了,没想到居然发电量就是超级源到源点的v,居然这么简单@.@ ...
- js获取当前日期加上30天之后的日期
var date1 = new Date(); var date2 = new Date(date1); date2.setDate(date1.getDate() + 30); console.lo ...
- 从客户端中检测到有潜在危险的 Request.Form 值 方法
由于在.net中,Request时出现有HTML或Javascript等字符串时,系统会认为是危险性值.立马报出“从客户端 中检测到有潜在危险的Request.Form值”这样的错. 解决方案一: ...
- bzoj1225
题解: 数论+报搜 首先套一个计算因子个数的公式 枚举一下这个数 代码: #include<bits/stdc++.h> using namespace std; ],res[],tmp[ ...
- MapReduce中文翻译
MapReduce:超大机群上的简单数据处理 摘要 MapReduce是一个编程模型,和处理,产生大数据集的相关实现.用户指定一个map函数处理一个key/value对,从而产生中间的key/va ...
- Type Script在Visual Studio 2013中的问题汇总(持续更新…)
TypeScript在vs2012下的问题 TypeScript对VS2012支持度比较低,建议升级为VS2013版本以上. 在VS2013中无法创建TypeScript项目 VS2013默认不支持T ...
- layers框架
- SVM大致思路整理
(一)线性可分 我们忽略建立目标函数的过程,直接写出目标函数. 原问题: 首先,我们得到了目标函数: 这是一个凸优化问题,直接可以用软件可以求解: 对偶问题: 原问题根据一系列的变换,可写成: 满足某 ...
- 堆排序(C语言实现)
一.堆的概念 所谓堆,它是一个数组,也能够被看成一个近似的全然二叉树.树上每一个结点相应数组的一个元素.二叉堆分为二种:最大堆和最小堆.本文主要介绍最大堆,最小堆类似.最大堆的特点:对于随意某个结点, ...