ulimit资源配置
2024-08-30 09:39:19
基本理解
linux对每个用户能使用的系统资源有一定限制。如果没有限制,在多用户登录,并且都消耗大量资源时,对系统产生复杂的影响。ulimit内建一套参数,来规定一个用户能使用多少资源。
[root@redis1-20 ~]# 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) 3780
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) 3780
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
core file size
内核文件大小:以块大小为单位。参数为c。默认为0,就是不产生core file。
core dump就是核心转储,程序发生异常退出时,操作系统会把程序当前的内存状况存储在一个core文件中。core文件的大小由-c参数设定,单位为blocks。默认为0,就是不产生core文件。
cd /data/my_app_dir
ulimit -c 10240000
killall my_app
sleep 1
./my_app 1>/dev/null 2>&1
#ulimit -c只对当前进程生效。
当发生core dump时,会在目录下有一个崩溃时产生的core文件,可以用于定位崩溃原因。
open file
一般都改成65535,还不行就改成655350
[root@webmaster data]# ulimit -n
1024
[root@webmaster data]#
[root@webmaster data]# ulimit -n 65535
[root@webmaster data]# ulimit -n
65535
[root@webmaster data]# ulimit -n 655350
[root@webmaster data]# ulimit -n
655350
最新文章
- Linux常用命令:文件与目录
- jQuery实现鼠标拖动改变Div高度
- Win7宽带一键创建
- 通过class和id获取DOM元素的区别
- 自动生存Makefile教程 autoscan aclocal autoconf autoheader automake configure
- Nhibernate Icreteria 分页查询
- dedecms 5.7文章编辑器附件上传图标不显示
- MySQL学习笔记(1) - cmd登陆和退出
- 实验吧Web-FALSE
- 二叉查找树的C++实现
- [译]《Sphinx权威指南》 - Sphinx入门
- app启动过程
- Tensorflow安装记录
- C++ 操作符、局部 全局变量及自动转换原则
- Several Service Control Manager Issues (Event ID's 7000, 7009, 7011)
- c++ 栈(顺序表)
- 【UOJ Round #8】
- 单片机小白学步系列(二十) IO口原理
- FD_CLOEXEC
- redhat5.5 x64 安装oracle 11g