ulimit命令用来限制系统用户对 shell 资源的访问,常见用法如下:

[root@localhost ~]$ ulimit -a            # 查看当前所有的资源限制
[root@localhost ~]$ ulimit -u 65535 # 限制用户能打开的最大进程数
[root@localhost ~]$ ulimit -SHn 65535 # 限制同一时间最多可打开的文件数

命令参数:

-a     All current limits are reported
-b The maximum socket buffer size
-c The maximum size of core files created
-d The maximum size of a process's data segment
-e The maximum scheduling priority ("nice")
-f The maximum size of files written by the shell and its children
-i The maximum number of pending signals
-l The maximum size that may be locked into memory
-m The maximum resident set size (many systems do not honor this limit)
-n The maximum number of open file descriptors (most systems do not allow this value to be set)
-p The pipe size in 512-byte blocks (this may not be set)
-q The maximum number of bytes in POSIX message queues
-r The maximum real-time scheduling priority
-s The maximum stack size
-t The maximum amount of cpu time in seconds
-u The maximum number of processes available to a single user
-v The maximum amount of virtual memory available to the shell and, on some systems, to its children
-x The maximum number of file locks
-T The maximum number of threads
-S   Set a soft limit for the given resource
-H   Set a hard limit for the given resource

命令输出:

[root@localhost ~]$ 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) 257403
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 65535
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 10240
cpu time (seconds, -t) unlimited
max user processes (-u) 65535
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited

线上的用法:

ulimit -u 65535
ulimit -SHn 65535
sed -i '/ulimit/d' /etc/rc.d/rc.local
echo "ulimit -u 65535" >> /etc/rc.d/rc.local
echo "ulimit -SHn 65535" >> /etc/rc.d/rc.local

Linux ulimit 命令的更多相关文章

  1. LINUX ulimit命令

    概述 系统性能一直是一个受关注的话题,如何通过最简单的设置来实现最有效的性能调优,如何在有限资源的条件下保证程序的运作,ulimit 是我们在处理这些问题时,经常使用的一种简单手段.ulimit 是一 ...

  2. Linux ulimit 命令 限制系统用户对 shell 资源的访问

    ulimit命令用来限制系统用户对 shell 资源的访问,常见用法如下: [root@MongoDB ~]# ulimit -a // 查看当前所有的资源限制 [root@MongoDB ~]# u ...

  3. Linux ulimit命令详解

    ulimit 是一个计算机命令,用于shell启动进程所占用的资源,可用于修改系统资源限制 命令常用参数 -H 设置硬资源限制. -S 设置软资源限制. -a 显示当前所有的资源限制. -c size ...

  4. linux系统资源限制———ulimit命令

    简介 Linux ulimit命令用于控制shell程序的资源. ulimit为shell内建指令,可用来控制shell执行程序的资源 推荐:https://blog.csdn.net/skiwnc/ ...

  5. linux的ulimit命令

    ulimit命令用来限制系统用户对shell资源的访问. 语法: ulimit [-acdfHlmnpsStv] [size] 选项介绍:    -a 显示当前所有的资源限制;    -c size: ...

  6. Linux 调优方案, 修改最大连接数(ulimit命令)【转】

    转自:http://blog.csdn.net/liangxiaozhang/article/details/8363435 Linux对于每个用户,系统限制其最大进程数.为提高性能,可以根据设备资源 ...

  7. linux修改文件打开最大数(ulimit命令)

    解除 Linux 系统的最大进程数和最大文件打开数限制:vi /etc/security/limits.conf# 添加如下的行* soft noproc 65536 * hard noproc 65 ...

  8. Linux 调优方案--ulimit命令

    可以用ulimit -a 来显示当前的各种用户进程限制.下面把某linux用户的最大进程数设为10000个:     ulimit -u 10240     对于需要做许多 socket 连接并使它们 ...

  9. (转)linux下进程的进程最大数、最大线程数、进程打开的文件数和ulimit命令修改硬件资源限制

    ulimit命令查看和更改系统限制 ulimit命令详解 ulimit用于shell启动进程所占用的资源,可以用来设置系统的限制 语法格式 ulimit [-acdfHlmnpsStvw] [size ...

随机推荐

  1. 在jsp里面不要瞎用<!-- -->注释

    如图: SEVERE: Servlet.service() for servlet jsp threw exceptionorg.apache.jasper.JasperException: /ch1 ...

  2. C#委托举例

    using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.T ...

  3. python基础系列教程——Python3.x标准模块库目录

    python基础系列教程——Python3.x标准模块库目录 文本 string:通用字符串操作 re:正则表达式操作 difflib:差异计算工具 textwrap:文本填充 unicodedata ...

  4. spark与flume整合

    spark-streaming与flume整合  push package cn.my.sparkStream import org.apache.spark.SparkConf import org ...

  5. 【C#】获取泛型<T>的真实类型

    需求:在包含泛型T的类或方法中,想要根据T的具体类型,进行相应的处理,需求伪代码如下: public void Test<T>() { if(T is string) { // do so ...

  6. C语言 · 因式分解

    算法提高 8-1因式分解   时间限制:10.0s   内存限制:256.0MB      问题描述 设计算法,用户输入合数,程序输出若个素数的乘积.例如,输入6,输出2*3.输入20,输出2*2*5 ...

  7. iio adc转换应用编写

    #include <stdio.h>        #include <stdlib.h>         #include <fcntl.h>         # ...

  8. Java类对象数组声明和初始化

    Java是纯面向对象语言.类是其重要构成单位. 然后,在实际编程中,我们会自己定义一些类,如Point <span style="font-size:14px;">pu ...

  9. Nutch系列1:简介

    由Java实现的,开放源代码(open-source)的web搜索引擎. Nutch 致力于让每个人都能很容易, 同时花费很少就可以配置世界一流的Web搜索引擎. 为了完成这一宏伟的目标, Nutch ...

  10. debian配置网络

    http://blog.csdn.net/ypist/article/details/8513274 vim /etc/resolv.conf   配置域名服务器 search test.ivic.o ...