网站运维笔记 网站运维笔记

CentOS6更换最新版内核&开启BBR优化算法

in 教程 read (4598) 站长Kevin.H 文章转载请注明来源!

开启BBR优化算法内核版本必须4.9以上
BBR算法配置简单,基本就是两行代码即可开启
速度据说比锐速更快
以下教程仅适用于CentOS6!
该文由博主从网上搜集资料整理并实际操作可行后发布,转载请注明出处!

开源地址

https://github.com/google/bbr

一、更换内核

参考网址:http://elrepo.org/tiki/tiki-index.php
导入Public Key

rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org

安装ELRepo源

rpm -Uvh http://www.elrepo.org/elrepo-release-6-6.el6.elrepo.noarch.rpm

请在安装该源之前,确保你的系统已经安装了yum-plugin-fastestmirror,一般的都已经安装,毕竟装机十几台都没遇到
安装完以后,这里有两步
1、直接更新到最新版的内核

yum --enablerepo=elrepo-kernel install kernel-ml

2、根据需求,安装特定版本的内核
打开内核下载页:http://elrepo.org/linux/kernel/el6/x86_64/RPMS/
将选定的版本内核wget到服务器上,然后安装对应的RPM包,如

rpm -Uvh kernel-ml-4.10.0-1.el6.elrepo.x86_64.rpm

查看当前机器内核

ls -l /boot

输入后显示如下内容

[root@tw-3 ~]# ls -l /boot
total 93576
-rw-r--r--. 1 root root   107134 Jul 23  2015 config-2.6.32-573.el6.x86_64
-rw-r--r--. 1 root root   108108 Jan 11 21:02 config-2.6.32-642.13.1.el6.x86_64
-rw-r--r--. 1 root root   182745 Feb 20 02:47 config-4.10.0-1.el6.elrepo.x86_64
drwxr-xr-x. 3 root root     4096 Jan 24 19:55 efi
drwxr-xr-x. 2 root root     4096 Feb 22 06:48 grub
-rw-------. 1 root root 24036511 Jan 24 19:57 initramfs-2.6.32-573.el6.x86_64.img
-rw-------. 1 root root 21949645 Jan 24 20:00 initramfs-2.6.32-642.13.1.el6.x86_64.img
-rw-------. 1 root root 25269845 Feb 22 06:48 initramfs-4.10.0-1.el6.elrepo.x86_64.img
-rw-r--r--. 1 root root   205998 Jul 23  2015 symvers-2.6.32-573.el6.x86_64.gz
-rw-r--r--. 1 root root   215528 Jan 11 21:02 symvers-2.6.32-642.13.1.el6.x86_64.gz
-rw-r--r--. 1 root root   341801 Feb 20 02:48 symvers-4.10.0-1.el6.elrepo.x86_64.gz
-rw-r--r--. 1 root root  2585052 Jul 23  2015 System.map-2.6.32-573.el6.x86_64
-rw-r--r--. 1 root root  2618532 Jan 11 21:02 System.map-2.6.32-642.13.1.el6.x86_64
-rw-------. 1 root root  3417065 Feb 20 02:47 System.map-4.10.0-1.el6.elrepo.x86_64
-rwxr-xr-x. 1 root root  4220560 Jul 23  2015 vmlinuz-2.6.32-573.el6.x86_64
-rwxr-xr-x. 1 root root  4269968 Jan 11 21:02 vmlinuz-2.6.32-642.13.1.el6.x86_64
-rwxr-xr-x. 1 root root  6247904 Feb 20 02:47 vmlinuz-4.10.0-1.el6.elrepo.x86_64

这里可以发现,我的机器有3个内核,分别是2.6.32-573.el6.x86_64、2.6.32-642.13.1.el6.x86_64、4.10.0-1.el6.elrepo.x86_64
这里,我们只需要4.10.0-1.el6.elrepo.x86_64这个最新版的
编辑menu.lst文件

nano /boot/grub/menu.lst

将其中的default改成0,这其中也要看你内核的排序,一般来说最新安装的都是排在最前面的


保存文件,并重启吧!
重启完成后,输入uname -r检查内核版本是否为最新

二、开启BBR算法优化

开启BBR,如果/etc/sysctl.conf文件有关于net.ipv4.tcp_congestion_control配置的,请注释掉
再输入

echo "net.core.default_qdisc=fq" >> /etc/sysctl.conf
echo "net.ipv4.tcp_congestion_control=bbr" >> /etc/sysctl.conf

保存生效sysctl -p
执行sysctl net.ipv4.tcp_available_congestion_control
如果结果中有BBR,则内核开启BBR算法成功
执行lsmod | grep bbr,看到tcp_bbr则说明BBR启动成功

图片来自 Leonn的博客


转载请注明出处(https://www.hilinux.cn/archives/google-bbr.html)
jrotty WeChat Pay

微信打赏

jrotty Alipay

支付宝打赏

文章二维码

扫描二维码,在手机上阅读!

更换内核bbr
最后由Kevin.H修改于2017-02-22 15:31
发表新评论
已有 5 条评论
  1. haliluya
    haliluya
    回复

    I and also my guys happened to be examining the excellent information and facts on the website and then immediately developed a terrible suspicion I had not thanked the web site owner for those tips. All of the guys became as a result passionate to learn them and now have in actuality been taking advantage of those things. I appreciate you for getting considerably helpful and also for deciding on certain fantastic subject matter most people are really eager to be informed on. My personal sincere regret for not expressing gratitude to sooner.

  2. RichardPouri

    Doctors have many challenges to face as they are perennially surrounded by patients, diseases, hospital duties and over-extended or odd shift timings. Universally, doctor is considered to be a noble profession and respectable one at that, but a doctor also has to work under immense pressures, emotional strains and other physical challenges.


    A regular physician like most of us at some point face will have to deal with personal situations such as important family affairs, family holidays, sickness or pregnancy that may force them to abandon medical duties. At the same time, a hospital or a healthcare facility is also constantly faced with emergency situations that demand all hands on deck round-the-clock. Therefore, every hospital, clinic or nursing home is compelled to hire locum tenens or substitute doctor in order to keep the staffing under control at all times.


    In fact, locum doctors are the most valuable asset for the medical community because they provide quality medical care and act as a helping-hand in emergency situations when the medical facilities need them the most.

    Unlike regular or permanent doctors, locum doctor jobs are also ideal career options for medical interns and graduates because they offer a wide array of medical exposure in varied medical specialties, work cultures and healthcare systems. Locum jobs are challenging and flexible, thus an increasing number of medical professionals have benefitted from these jobs, so whether one is looking for a family physicians position or in a hospital or in a clinic, locum jobs for doctors are available at all levels and in different healthcare systems.


    In addition, being a locum doctor gives a medical professional the control over their working hours, location of work and choice of area of specialisation. Technically, locum positions are not restricted to general physicians but they are also extended to other fields of medical specialisations such as cardiology, neurology and many more.

    Travelling can be an integral part of locum jobs, and these distinctive features are a boon for many dedicated medical professionals who are eager to expand their medical careers with loads of multi-cultural medical experiences. The fact that locum agencies in the UK recruit tens of thousands of locums from across the globe in various NHS hospitals, private clinics, nursing homes and other public hospitals speaks volume of the popularity of locum jobs.


    Locating or getting a locum tenens job is a simple task as long as you are registered with one of the many reputable locum agencies. These agencies act as the middle man between locum tenens and medical facilities, and they also look after all the details pertaining to travel for locum tenens, accommodation and the nature of locum work.

    Thus, maintaining a healthy locum doctor-agency relationship benefits both the parties, and it also increases the probability of getting recommendable employment opportunities and businesses or vice-versa.

  3. 终极科学上网2.0 – Linode VPS 安装 ShadowSocksR-沈观群

    [...]Enjoy it! 最后,请重启下服务器,用指令:reboot 三、下载SSR客户端(小飞机)任意一个连接都可以:https://github.com/shadowsocksr-backup/shadowsocksr-csharp/releaseshttps://www.letxxt.com/wp-content/uploads/2017/07/ShadowsocksR-4.6[...]

  4. Z4HD
    Z4HD
    回复

    CentOS修改默认启动内核怕是得修改`/etc/grub.conf`

  5. Z4HD
    Z4HD
    回复

    已收藏,,,

前篇 后篇
雷姆
拉姆