[学习]ulimit
ulimit
User limits - limit the use of system-wide resources.
Syntax
ulimit [-acdfHlmnpsStuv] [limit] Key
-S Set a soft limit for the given resource
-H Set a hard limit for the given resource -a All current limits are reported.
-c The maximum size of core files created.
-d The maximum size of a process's data segment.
-f The maximum size of files created by the shell(default option)
-l The maximum size that can be locked into memory.
-m The maximum resident set size.
-n The maximum number of open file descriptors.
-p The pipe buffer size.
-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 process.
ulimit provides control over the resources available to the shell and to processes started by it, on systems that allow such control.
The soft limit is the value that the kernel enforces for the corresponding resource. The hard limit acts as a ceiling for the soft limit.
An unprivileged process may only set its soft limit to a value in the range from 0 up to the hard limit, and (irreversibly) lower its hard limit. A privileged process can make arbitrary changes to either limit value.
If limit is given, it is the new value of the specified resource. Otherwise, the current value of the soft limit for the specified resource is printed, unless the '-H' option is supplied.
When setting new limits, if neither '-H' nor '-S' is supplied, both the hard and soft limits are set.
Restricting per user processes ( -u) can be useful for limiting the potential effects of a fork bomb.
Values are in 1024-byte increments, except for '-t', which is in seconds, '-p', which is in units of 512-byte blocks, and '-n' and '-u', which are unscaled values.
The return status is zero unless an invalid option is supplied, a non-numeric argument other than unlimited is supplied as a limit, or an error occurs while setting a new limit.
This is a BASH shell builtin, to display your local syntax from the bash prompt type: help ulimit
Example
$ ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 20
file size (blocks, -f) unlimited
pending signals (-i) 16382
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) unlimited
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
“Every man is a damn fool for at least five minutes every day; wisdom consists of not exceeding that limit” ~ Elbert Hubbard
[学习]ulimit的更多相关文章
- JVM虚拟机宕机_java.lang.OutOfMemoryError: unable to create new native thread
原因:当前用户的系统最最大程序数数已达到最大值,使用ulimit -u可以看到是1024 解决办法:在当前用户下使用ulimit -u 65535 然后再执行jsp,一切ok 功能说明:控 ...
- 学习笔记之ulimit
Linux对于每个用户,系统限制其最大进程数.为提高性能,可以根据设备资源情况,设置各linux 用户的最大进程数.可以用ulimit -a 来显示当前的各种用户进程限制. Linux/Unix ul ...
- ulimit命令学习
通过ulimit -n命令可以查看linux系统里打开文件描述符的最大值,一般缺省值是1024,对一台繁忙的服务器来说,这个值偏小,所以有必要重新设置linux系统里打开文件描述符的最大值.那么应该在 ...
- shell学习(8)- ulimit调优系统参数
ulimit:显示(或设置)用户可以使用的资源的限制(limit),这限制分为软限制(当前限制)和硬限制(上限),其中硬限制是软限制的上限值,应用程序在运行过程中使用的系统资源不超过相应的软限制,任何 ...
- MongoDB学习笔记—Linux下搭建MongoDB环境
1.MongoDB简单说明 a MongoDB是由C++语言编写的一个基于分布式文件存储的开源数据库系统,它的目的在于为WEB应用提供可扩展的高性能数据存储解决方案. b MongoDB是一个介于关系 ...
- 快速学习C语言二: 编译自动化, 静态分析, 单元测试,coredump调试,性能剖析
上次的Hello world算是入门了,现在学习一些相关工具的使用 编译自动化 写好程序,首先要编译,就用gcc就好了,基本用法如下 gcc helloworld.c -o helloworld.o ...
- 常见linux命令释义(第七天)——ulimit 与变量内容的删除替代与替换。
linux是一个多用户多任务的系统,不同于windows的单人多任务操作系统.再linux上,在同一个时间点上,可以有多个人同时执行多个任务. 那么假若有10个用户,同时打开了100个100M的文件. ...
- NoSQL之【MongoDB】学习(三):配置文件说明
摘要: 继上一篇NoSQL之[MongoDB]学习(一):安装说明 之后,知道了如何安装和启动MongoDB,现在对启动时指定的配置文件(mongodb.conf)进行说明,详情请见官方. 启动Mon ...
- docker学习笔记一:基本安装和设置容器静态ip
docker是一个lxc升级版的容器类虚拟环境,具有快速部署,灵活,易迁移的虚拟机模式,现在各大公司已经开始广泛使用为了自己方便学习linux,需要多台虚拟机环境,但是vmware开启多台虚拟机时需要 ...
随机推荐
- 【JUC源码解析】DelayQueue
简介 基于优先级队列,以过期时间作为排序的基准,剩余时间最少的元素排在队首.只有过期的元素才能出队,在此之前,线程等待. 源码解析 属性 private final transient Reentra ...
- Model详解
一.数据库操作 Model操作: 创建数据库表结构(建表) 操作数据库表(增删改查) 做一部分的验证(验证) a.建表 1.表字段 AutoField(Field) - int自增列,必须填入参数 p ...
- shell中中括号的使用
原文出处:https://www.jianshu.com/p/855c9fb373ff Shell 里面的方括号(包括单中括号与双中括号)可用于以下三种情况的判断: 算术比较. 比如一个变量是否为0, ...
- Go的CSP并发模型
golang的goroutine机制: 一.go 内部有三个对象: P对象(processor) 代表上下文(或者可以认为是cpu),M(work thread)代表工作线程,G对象(g ...
- python—索引与切片总结
python中索引与切片的熟练掌握对于字符串的操作很有帮助,梳理如下: (1)索引 S = 'hello world' 1)正向索引 正向索引从0开始,向右依次递增. 2)反向索引 反向索引从-1开始 ...
- 关于nodejs中遇到mysql默认8小时连接断开机制的终极简单解决方案
由于mysql默认8小时连接无访问,就会断开.为此查了一下资料,有同种比较简单的解决方案: 1. 增加 MySQL 的 wait_timeout 属性的值. 修改 /etc/mysql/my.cnf文 ...
- Tomcat java zabbix 监控
排除汤姆猫错误的步骤 ps-ef | grep java或jps –lvm 查看java pid进程 netstat –lntup | grep java 查看java 端口有没有启动 查看 tomc ...
- Refs 和 DOM
在常规的 React 数据流中,props 是父组件与子组件交互的唯一方式.要修改子元素,你需要用新的 props 去重新渲染子元素.然而,在少数情况下,你需要在常规数据流外强制修改子元素.被修改的子 ...
- Scrum立会报告+燃尽图(十二月九日总第四十次):视频剪辑与用户反馈
此作业要求参见:https://edu.cnblogs.com/campus/nenu/2018fall/homework/2484 项目地址:https://git.coding.net/zhang ...
- Daily Scrum (2015/10/31)
这几天我们组的进度有点慢,剩下这一周的我们必须要加油认真对待. 周末这两天我们是这样安排的: 成员 今日任务 时间 明日任务 符美潇 数据库部分代码的编写 1h 每周小组例会 潘礼鹏 团队博客作业 ...