首页 > 系统相关 >Centos 7.6 永久生效 最大进程数、打开文件数 Ulimit -a

Centos 7.6 永久生效 最大进程数、打开文件数 Ulimit -a

时间:2022-10-15 19:22:56浏览次数:40  
标签:Centos Ulimit root kbytes ulimit 7.6 memory 204800 size

1.通过命令ulimit -a查看当前系统

[root@db01 ~18:50:18]# cat /etc/redhat-release
CentOS Linux release 7.6.1810 (Core)
[root@db01 ~18:50:24]# 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) 3805
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 1024
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) 3805
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited

2.通过命令ulimit -n 查看打开文件数量

[root@db01 ~18:55:50]# ulimit -n
1024

3.修改配置文件

#1.cat /etc/security/limits.conf|grep 204800

* soft nofile 204800
* hard nofile 204800
* soft nproc 204800
* hard nproc 204800

在limits.conf最后面加下以上文件

其中:

*             代表针对所有用户 
noproc     是代表最大进程数 
nofile     是代表最大文件打开数

#2.cd /etc/security/limits.d,在20-nproc.conf文件尾部添加以下两行保存退出

[root@db01 /etc/security/limits.d19:04:58]# cat 20-nproc.conf |grep 204800
* soft nproc 204800
* hard nproc 204800

 4.配置生效

1.断开xshell链接,重新链接
查看

[root@db01 ~19:07:40]# ulimit -n
204800
[root@db01 ~19:07:46]# 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) 3805
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 204800
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) 204800
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited

 

2.重启虚拟机

reboot

 

标签:Centos,Ulimit,root,kbytes,ulimit,7.6,memory,204800,size
From: https://www.cnblogs.com/linuxmysql/p/16794837.html

相关文章

  • Docker | dockerfile构建centos镜像,以及CMD和ENTRYPOINT的区别
    构建自己的centos镜像dockerpullcentos下载下来的镜像都是基础版本,缺少很多常用的命令功能,比如:ll、vim等等,下面介绍制作一个功能较全的自己的centos镜像。步骤1、编......
  • CentOS最小化安装后找不到ifconfig命令
    1.ifconfig命令是设置或显示网络接口的程序,可以显示出我们机器的网卡信息,可是有些时候最小化安装CentOS等Linux发行版的时候会默认不安装ifconfig等命令,这时候你进入终端......
  • Centos 8 升级内核通过elrepo源
    一、Centos8升级内核通过elrepo源地址https://www.kernel.orghttp://elrepo.org/tiki/tiki-index.php 查看linux内核版本[root@localhost~]#cat/proc/versio......
  • Centos7安装配置jenkins
    安装前准备注:jenkins依赖jdk环境,需提前安装配置(如已安装请跳过)一、jdk8安装配置jdk8下载地址:https://www.oracle.com/java/technologies/javase/jdk8-arm-downloads.htm......
  • centos7.9 安装postgres15数据库
    1.安装yum仓库yuminstall-yhttps://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm2.安装环境依赖(1).安装lib......
  • centOS7图形化安装(最小化安装的基础上安装)
    ┌──[[email protected]]-[~/awx-operator]└─$yumgrouplist已加载插件:fastestmirror没有安装组信息文件Mayberun:yumgroupsmarkconvert(see......
  • Centos8火狐浏览器升级
    1.提前下载好火狐浏览器安装包,如下:[root@T桌面]#lsFirefox-latest-x86_64.tar.bz2Firefox-latest-x86_64.tar.bz22.解压安装包并查看,过程如下:[root@T桌面]#tar-xfFi......
  • CentOS7脚本安装GitLab
    #!/bin/bashyuminstall-ycurlpolicycoreutils-pythonopenssh-serverperlsystemctlenablesshdsystemctlstartsshdfirewall-cmd--permanent--add-service=httpfi......
  • Centos8修改Root密码
    1.reboot重启时候见到这种按e  2.找到linux那行的末尾对rhgbquiet进行删除     输入rd.break 输入完成后按住ctrl+x继续执行  3.这里输入mount......
  • centos7设置固定ip,连接互联网
    第一步:将虚拟机网络设置为桥接模式   第二部:启动虚拟机,修改配置文件1.查看windos主机的默认网关:(在虚拟机的windos主机上输入cmd然后ipconfig查看默认网关)2.启动......