zoukankan      html  css  js  c++  java
  • jenkins服务器进程限制配置

    当应用程序占满进程数后,则会报错如下

    Resource temporarily unavailable

    新用户的进程数限制一般都是在2048或者4096。

    解决方案

    1、使用root用户登陆,进入到/etc/security/limits.d/:

    zhangsan@ubuntu-server: cd /etc/security/limits.d

    2、检查该文件夹下有没有文件,如没有,新建

    touch 20-nproc.conf


    3、编辑20-nproc.conf,添加以下内容:

    * soft nproc 4096
    root soft nproc unlimited
    zhangsan     soft nproc 60000

    4、编辑/etc/security/limits.conf,添加以下内容:

    “username” soft nproc 60000
    “username” hard nproc 65535
    “username” soft nofile 60000
    “username” hard bofile 65535

    添加后文件为:
    * soft nofile 100001
    * hard nofile 100002
    * soft nproc 60000
    * hard nproc 65535
    root soft nofile 100001
    root hard nofile 100002
    root soft nproc 60000
    root hard nproc 65535

    nproc:表示max number of processes
    nofile:表示max number of open file descriptors
    hard/soft:soft是一个警告值,而hard则是一个真正意义的阀值,超过就会报错。
    username: 想使所有用户就用'*' 代替

    5、再次切换到username用户,执行ulimit -a:
    zhangsan@ubuntu-server:~/.ssh$ ulimit -a
    core file size (blocks, -c) 0
    data seg size (kbytes, -d) unlimited
    scheduling priority (-e) 0
    file size (blocks, -f) unlimited
    pending signals (-i) 31663
    max locked memory (kbytes, -l) 16384
    max memory size (kbytes, -m) unlimited
    open files (-n) 100001
    pipe size (512 bytes, -p) 8
    POSIX message queues (bytes, -q) 819200
    real-time priority (-r) 0
    stack size (kbytes, -s) 8192
    cpu time (seconds, -t) unlimited
    max user processes (-u) 60000
    virtual memory (kbytes, -v) unlimited
    file locks (-x) unlimited

    三十六般武艺,七十二般变化,修练出个人品牌并发出光芒
  • 相关阅读:
    《计算机网络 自顶向下方法》 第3章 运输层 Part1
    Java 字符串截取问题
    Java 字符排序问题
    Linux 下实时查看日志
    Java项目 打war包方法
    Linux 下 安装jdk 1.7
    Linux 下安装jetty服务器
    Linux 系统下安装 rz/sz 命令及使用说明
    Xshell
    Linux 常用命令大全
  • 原文地址:https://www.cnblogs.com/deeptester-vv/p/14266465.html
Copyright © 2011-2022 走看看