V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
wsgzao
V2EX  ›  程序员

sysctl.conf 学习和调优

  •  
  •   wsgzao ·
    wsgzao · 2015-08-11 16:15:27 +08:00 · 3490 次点击
    这是一个创建于 3190 天前的主题,其中的信息可能已经有所发展或是发生改变。

    前言

    记得第一次接触/etc/security/limits.conf/etc/sysctl.conf时是因为部署Oracle时要按需修改内核参数。limits.conf文件实际是Linux PAM(插入式认证模块,Pluggable Authentication Modules)中 pam_limits.so 的配置文件,突破系统的默认限制,对系统访问资源有一定保护作用。 limits.conf 和sysctl.conf区别在于limits.conf是针对用户,而sysctl.conf是针对整个系统参数配置。

    调整limits.conf和sysctl.conf参数是有必要的


    更新历史

    2015年08月10日 - 初稿

    阅读原文 - http://wsgzao.github.io/post/sysctl/

    扩展阅读

    设置Sysctl.conf用以提高Linux的性能(最完整的sysctl.conf优化方案) - http://blog.csdn.net/21aspnet/article/details/6584792
    limits.conf工作原理 - http://my.oschina.net/987openlab/blog/94634
    ulimit命令 - http://man.linuxde.net/ulimit
    Sysctl学习 - http://pengyao.org/sysctl-1.html
    Kernel sysctl configuration file for Linux - https://klaver.it/linux/sysctl.conf
    LTMP索引 - http://wsgzao.github.io/index/#LTMP

    5 条回复    2015-08-12 19:49:11 +08:00
    kiritoalex
        1
    kiritoalex  
       2015-08-11 18:56:30 +08:00 via Android
    已收藏√
    immjun
        2
    immjun  
       2015-08-11 19:45:03 +08:00
    感谢分享~
    adaibee
        3
    adaibee  
       2015-08-12 11:16:50 +08:00
    已经收藏,正好最近有用到
    denghongcai
        4
    denghongcai  
       2015-08-12 16:23:01 +08:00
    ```
    net.ipv4.tcp_tw_recycle = 1
    #开启TCP连接复用功能,允许将time_wait sockets重新用于新的TCP连接(主要针对time_wait连接)
    net.ipv4.tcp_tw_reuse = 1
    ```
    看到这两条我就醉了
    wsgzao
        5
    wsgzao  
    OP
       2015-08-12 19:49:11 +08:00 via Android
    @denghongcai 所以你看我用在生产的配置就不会加入一些有歧义的参数
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2756 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 15:01 · PVG 23:01 · LAX 08:01 · JFK 11:01
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.