基本理解

  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

  

最新文章

  1. Linux常用命令:文件与目录
  2. jQuery实现鼠标拖动改变Div高度
  3. Win7宽带一键创建
  4. 通过class和id获取DOM元素的区别
  5. 自动生存Makefile教程 autoscan aclocal autoconf autoheader automake configure
  6. Nhibernate Icreteria 分页查询
  7. dedecms 5.7文章编辑器附件上传图标不显示
  8. MySQL学习笔记(1) - cmd登陆和退出
  9. 实验吧Web-FALSE
  10. 二叉查找树的C++实现
  11. [译]《Sphinx权威指南》 - Sphinx入门
  12. app启动过程
  13. Tensorflow安装记录
  14. C++ 操作符、局部 全局变量及自动转换原则
  15. Several Service Control Manager Issues (Event ID's 7000, 7009, 7011)
  16. c++ 栈(顺序表)
  17. 【UOJ Round #8】
  18. 单片机小白学步系列(二十) IO口原理
  19. FD_CLOEXEC
  20. redhat5.5 x64 安装oracle 11g

热门文章

  1. J2SE核心开发实战(二)——字符串与包装类
  2. Hadoop提供的reduce函数中Iterable 接口只能遍历一次的问题
  3. sql建表,建索引注意事项
  4. JavaScript算法题(二) && 数组filter使用
  5. MySQL基本语句优化10个原则
  6. Fastreport生成WEB报表
  7. ReactNative Android 研究
  8. POJ3074 Sudoku —— Dancing Links 精确覆盖
  9. mongodb mongod 参数解释
  10. 包、修饰符、内部类、匿名内部类(java基础知识十)