ulimit

最后更新于:2022-04-02 03:51:00

[TOC] ## 实例 ### 查看当前限制参数: ``` ulimit -a guli@guli-Ubuntu1:~$ ulimit -a core file size (blocks, -c) 0 (core dump 文件大小) data seg size (kbytes, -d) unlimited scheduling priority (-e) 0 file size (blocks, -f) unlimited pending signals (-i) 7685 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) 7685 virtual memory (kbytes, -v) unlimited file locks (-x) unlimited ``` ### 临时、立即生效的修改: ``` # ulimit -n 65535 ``` ### 永久生效的修改: vim /etc/security/limits.conf ``` 在文件尾部添加如下代码: * soft nofile 10240 * hard nofile 10240 ```
';