[root@DaMoWang ~]# vim /etc/sysctl.conf
#关闭ipv6
net.ipv6.conf.all.disable_ipv6 =
net.ipv6.conf.default.disable_ipv6 = # 避免放大攻击
net.ipv4.icmp_echo_ignore_broadcasts = # 开启恶意icmp错误消息保护
net.ipv4.icmp_ignore_bogus_error_responses = #关闭路由转发
net.ipv4.ip_forward =
net.ipv4.conf.all.send_redirects =
net.ipv4.conf.default.send_redirects = #开启反向路径过滤
net.ipv4.conf.all.rp_filter =
net.ipv4.conf.default.rp_filter = #处理无源路由的包
net.ipv4.conf.all.accept_source_route =
net.ipv4.conf.default.accept_source_route = #关闭sysrq功能
kernel.sysrq = #core文件名中添加pid作为扩展名
kernel.core_uses_pid = # 开启SYN洪水攻击保护
net.ipv4.tcp_syncookies = #修改消息队列长度
kernel.msgmnb =
kernel.msgmax = #设置最大内存共享段大小bytes
kernel.shmmax =
kernel.shmall = #timewait的数量,默认180000
net.ipv4.tcp_max_tw_buckets =
net.ipv4.tcp_sack =
net.ipv4.tcp_window_scaling =
net.ipv4.tcp_rmem =
net.ipv4.tcp_wmem =
net.core.wmem_default =
net.core.rmem_default =
net.core.rmem_max =
net.core.wmem_max = #每个网络接口接收数据包的速率比内核处理这些包的速率快时,允许送到队列的数据包的最大数目
net.core.netdev_max_backlog = #限制仅仅是为了防止简单的DoS 攻击
net.ipv4.tcp_max_orphans = #未收到客户端确认信息的连接请求的最大值
net.ipv4.tcp_max_syn_backlog =
net.ipv4.tcp_timestamps = #内核放弃建立连接之前发送SYNACK 包的数量
net.ipv4.tcp_synack_retries = #内核放弃建立连接之前发送SYN 包的数量
net.ipv4.tcp_syn_retries = #启用timewait 快速回收
net.ipv4.tcp_tw_recycle = #开启重用。允许将TIME-WAIT sockets 重新用于新的TCP 连接
net.ipv4.tcp_tw_reuse =
net.ipv4.tcp_mem =
net.ipv4.tcp_fin_timeout = #当keepalive 起用的时候,TCP 发送keepalive 消息的频度。缺省是2 小时
net.ipv4.tcp_keepalive_time = #允许系统打开的端口范围
net.ipv4.ip_local_port_range = #修改防火墙表大小,默认65536
#net.netfilter.nf_conntrack_max=
#net.netfilter.nf_conntrack_tcp_timeout_established= # 确保无人能修改路由表
net.ipv4.conf.all.accept_redirects =
net.ipv4.conf.default.accept_redirects =
net.ipv4.conf.all.secure_redirects =
net.ipv4.conf.default.secure_redirects =

使其生效

[root@DaMoWang ~]# sysctl -p
sysctl: /etc/sysctl.conf(): invalid syntax, continuing...
net.ipv6.conf.all.disable_ipv6 =
net.ipv6.conf.default.disable_ipv6 =
net.ipv4.icmp_echo_ignore_broadcasts =
net.ipv4.icmp_ignore_bogus_error_responses =
net.ipv4.ip_forward =
net.ipv4.conf.all.send_redirects =
net.ipv4.conf.default.send_redirects =
net.ipv4.conf.all.rp_filter =
net.ipv4.conf.default.rp_filter =
net.ipv4.conf.all.accept_source_route =
net.ipv4.conf.default.accept_source_route =
kernel.sysrq =
kernel.core_uses_pid =
net.ipv4.tcp_syncookies =
kernel.msgmnb =
kernel.msgmax =
kernel.shmmax =
kernel.shmall =
net.ipv4.tcp_max_tw_buckets =
net.ipv4.tcp_sack =
net.ipv4.tcp_window_scaling =
net.ipv4.tcp_rmem =
net.ipv4.tcp_wmem =
net.core.wmem_default =
net.core.rmem_default =
net.core.rmem_max =
net.core.wmem_max =
net.core.netdev_max_backlog =
net.ipv4.tcp_max_orphans =
net.ipv4.tcp_max_syn_backlog =
net.ipv4.tcp_timestamps =
net.ipv4.tcp_synack_retries =
net.ipv4.tcp_syn_retries =
net.ipv4.tcp_tw_recycle =
net.ipv4.tcp_tw_reuse =
net.ipv4.tcp_mem =
net.ipv4.tcp_fin_timeout =
net.ipv4.tcp_keepalive_time =
net.ipv4.ip_local_port_range =
net.ipv4.conf.all.accept_redirects =
net.ipv4.conf.default.accept_redirects =
net.ipv4.conf.all.secure_redirects =
net.ipv4.conf.default.secure_redirects =

CentOS 7 内核优化的更多相关文章

  1. 生产服务器环境最小化安装后 Centos 6.5优化配置[转]

    内容目录 centos6.5最小化安装后配置网络: IP地址, 网关, 主机名, DNS 更新系统源并且升级系统 系统时间更新和设定定时任 创建普通用户并进行sudo授权管理 修改SSH端口号和屏蔽r ...

  2. 生产环境下Centos 6.5优化配置 (装载)

    本文 centos 6.5 优化 的项有18处: 1.centos6.5最小化安装后启动网卡 2.ifconfig查询IP进行SSH链接 3.更新系统源并且升级系统 4.系统时间更新和设定定时任 5. ...

  3. [转]Centos 6.5 优化 一些基础优化和安全设置

    关于CentOS服务器的优化下文作为参考. 本文 centos 6.5 优化 的项有18处: 1.centos6.5最小化安装后启动网卡2.ifconfig查询IP进行SSH链接3.更新系统源并且升级 ...

  4. 生产服务器环境最小化安装后 Centos 6.5优化配置备忘

    生产服务器环境最小化安装后 Centos 6.5优化配置备忘 作者:Memory 发布于:2014-8-13 15:00 Wednesday 服务器 本文 centos 6.5 优化 的项有18处: ...

  5. 生产服务器环境最小化安装后Centos 6.5优化配置备忘

    生产服务器环境最小化安装后 Centos 6.5优化配置备忘 本文 centos 6.5 优化 的项有18处,列表如下: 1.centos6.5最小化安装后启动网卡 2.ifconfig查询IP进行S ...

  6. Centos 6.5 优化 一些基础优化和安全设置

    原文链接:http://www.centoscn.com/CentosSecurity/CentosSafe/2015/0424/5263.html 本文 centos 6.5 优化 的项有18处: ...

  7. [效果不错] nginx 高并发参数配置及linux内核参数优化,完整的内核优化设置。PHP-FPM高负载解决办法。

    背景:对vps小资源的实践中对,https://justwinit.cn/post/7536/ 的再优化,再实践,再优化,特别是Nginx,PHP,内核: 零)Nginx: error_log /da ...

  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. RHEL/CentOS通用性能优化、安全配置参考

    RHEL/CentOS通用性能优化.安全配置参考 本文的配置参数是笔者在实际生产环境中反复实践总结的结果,完全适用绝大多数通用的高负载.安全性要求的网络服务器环境.故可以放心使用. 若有异议,欢迎联系 ...

随机推荐

  1. 【ABP】工作单元——不进行事物独立执行功能

    1.注入 private readonly IUnitOfWorkManager unitOfWorkManager; 2.构造 3.开启新事物 using (var unitOfWork = uni ...

  2. C# 堆栈(Stack)和队列(Queue)

    一.什么是堆?(Heap)      堆是无序的,是一片不连续的内存域,由用户自己来控制和释放,如果用户自己不释放的话,当内存达到一定的特定值时,通过垃圾回收器(GC)来回收.      是程序运行期 ...

  3. vscode断点调试工程化客户端文件

    一.调试webpack配置文件 launch.json的配置如下,在webpack.dev.config.js文件中设置断点,开始调试. { "version": "0. ...

  4. Scrapy基础(十四)————Scrapy实现知乎模拟登陆

    模拟登陆大体思路见此博文,本篇文章只是将登陆在scrapy中实现而已 之前介绍过通过requests的session 会话模拟登陆:必须是session,涉及到验证码和xsrf的写入cookie验证的 ...

  5. [POJ2054]Color a Tree (并查集+贪心)

    POJ终于修好啦 题意 和UVA1205是同一题,在洛谷上是紫题 有一棵树,需要给其所有节点染色,每个点染色所需的时间是一样的都是11.给每个点染色,还有一个开销“当前时间×ci×ci”,cici是每 ...

  6. React(五)State属性

    React 里,只需更新组件的 state,然后根据新的 state 重新渲染用户界面(不要操作 DOM). 以下实例创建一个名称扩展为 React.Component 的 ES6 类,在 rende ...

  7. 201771010126.王燕《面向对象程序设计(Java)》第六周学习总结

    实验六 继承定义与使用 实验时间 2018-9-28 1.实验目的与要求 (1) 理解继承的定义: 继承就是用已有类来构建新类的一种机制,当你继承了一个类时,就继承了这个类的方法和字段,同时你也可以在 ...

  8. [bzoj1051]Popular Cows

    刚刚被ysy在联考里虐了,差点爆tan(pi/4),只好来bzoj寻求安慰再被虐一次233 (tarjan是什么智障东西不想打我好弱啊,tarjan都不会打) Description 每一头牛的愿望就 ...

  9. 18 徐州 M

    听了遍dls的讲解觉得这是个沙比题,结果调了两个小时... 主要注意的点有两个, 一个是 找每个灯覆盖的区间,这个用叉积看一下夹角即可 一个是 覆盖的时候点覆盖比边覆盖好写(个人感觉) 点覆盖的话,如 ...

  10. SPARK-18560

    ##### Receiver data can not be dataSerialized properly. ``` // :: ERROR executor.Executor: Exception ...