V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
Distributions
Ubuntu
Fedora
CentOS
中文资源站
网易开源镜像站
king1688888888
V2EX  ›  Linux

请教关于 Linux 用户资源配置文件(limits.conf)

  •  
  •   king1688888888 · Mar 10, 2020 · 2793 views
    This topic created in 2239 days ago, the information mentioned may be changed or developed.
    请教各位大神关于 Linux 用户资源配置的问题,在 RHEL6 系统下,用户资源配置文件为:
    /etc/security/limits.conf
    /etc/security/limits.d/90-nproc.conf

    两个配置文件的区别已百度谷歌一番,大概差异明白了。假设现在服务器上运行着占用资源高的程序(比如 XX 国产数据库、JAVA 程序),我并不熟悉这些程序,官方也没有提供 limits 推荐值。为了不出现资源不足的告警,能否使用以下配置方案?如果不可以使用,请教一下这样配置有何坏处?

    # cat /etc/security/limits.conf

    * soft nproc 65535
    * hard nproc 65535
    * soft nofile 65535
    * hard nofile 65535

    # cat /etc/security/limits.d/90-nproc.conf

    root soft nproc unlimited
    * soft nproc 65535
    * hard nproc 65535
    * soft nofile 65535
    * hard nofile 65535
    2 replies    2020-03-10 18:16:58 +08:00
    julyclyde
        1
    julyclyde  
       Mar 10, 2020
    asilin
        2
    asilin  
       Mar 10, 2020 via Android
    资源足够的话,一般没有坏处,除非程序有 bug。

    另外,需要注意的是对于运行中的程序,设置后得重启服务才能生效。
    但是你也可以使用 prlimit 程序进行动态设置,这样就不需要重启服务了。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2641 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 74ms · UTC 15:55 · PVG 23:55 · LAX 08:55 · JFK 11:55
    ♥ Do have faith in what you're doing.