标签: ulimit

什么是安全的 ulimit 上限?

这是输出 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) 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 …
Run Code Online (Sandbox Code Playgroud)

server filesystem ulimit

7
推荐指数
1
解决办法
5183
查看次数

Ulimit 和 make_sock 错误

我正在尝试为 Ubuntu 11.10 配置 Redmine,在 11.10 中使用这种方法Redmine,但在某处与 apache 遇到了一些疯狂的障碍。发出 service apache2 restart 后,我​​收到以下错误。

 * Restarting web server apache2
ulimit: 88: error setting limit (Operation not permitted)
ulimit: 88: error setting limit (Operation not permitted)
(13)Permission denied: make_sock: could not bind to address 0.0.0.0:80 no listening sockets available, shutting down
Unable to open logs
Run Code Online (Sandbox Code Playgroud)

我一直无法弄清楚 apache 到底发生了什么。我了解 ulimit 的作用(监视系统范围的资源分配)但不知道为什么不允许设置限制?

这是/etc/apache2/sites-available/default 的内容,问题的根源可能是...

<VirtualHost *:80>
    ServerAdmin jd@neongecko.com

    DocumentRoot /var/www
    <Directory />
        Options FollowSymLinks
        AllowOverride None
    </Directory>
    <Directory /var/www/>
        Options Indexes FollowSymLinks …
Run Code Online (Sandbox Code Playgroud)

11.10 apache2 ulimit redmine

7
推荐指数
1
解决办法
1万
查看次数

永久设置进程限制

您如何ulimit -u在 Ubuntu 中永久设置每个用户 ( ) 的进程限制?

process ulimit resource-limiting

6
推荐指数
2
解决办法
1万
查看次数

nofile ulimit -n 在 Ubuntu 14.04 LTS 上

? sudo sysctl -a|grep file

fs.file-max = 2037581
fs.file-nr = 2784   0   2037581

? ~ cat /proc/sys/fs/file-max
2037581

? ~ cat /proc/sys/fs/file-nr
2720    0   2037581
Run Code Online (Sandbox Code Playgroud)

/etc/security/limits.conf

* hard nofile 2037581
* soft nofile 2037581
root hard nofile 2037581
root soft nofile 2037581
Run Code Online (Sandbox Code Playgroud)

/etc/pam.d/su

session required pam_limits.so
Run Code Online (Sandbox Code Playgroud)

/etc/pam.d/common-session

session required pam_limits.so
Run Code Online (Sandbox Code Playgroud)

然后重新启动。

但是 ulimit -n 又得到了 1024。

只能 ulimit -n 4096 作为最大值

或出错

 ulimit: value exceeds hard limit
Run Code Online (Sandbox Code Playgroud)

ulimit 14.04

6
推荐指数
2
解决办法
2万
查看次数

bash fork:重试:资源暂时不可用

我正在尝试运行一个 shell 脚本,它将使用 shell 脚本创建进程。我收到资源暂时不可用错误。如何确定哪个限制(内存/进程/文件计数)造成了这个问题。下面是我的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) 563959
max locked memory       (kbytes, -l) unlimited
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) unlimited
cpu time               (seconds, -t) unlimited
max user processes              (-u) 10000000 …
Run Code Online (Sandbox Code Playgroud)

bash memory-usage ulimit

6
推荐指数
1
解决办法
9781
查看次数

打开的文件太多

当我打开 Lutris 然后打开 LOL 客户端时,就会发生这种情况。游戏永远不会好。我尝试了很多东西,但永远无法更改打开文件限制。如何解决这个问题?

Waiting on children  
Waiting on children  
eventfd: Too many open files  
eventfd: Too many open files  
eventfd: Too many open files  
esync: write: Bad file descriptor  
eventfd: Too many open files  
eventfd: Too many open files  
eventfd: Too many open files  
esync: write: Bad file descriptor  
eventfd: Too many open files  
eventfd: Too many open files  
eventfd: Too many open files  
eventfd: Too many open files  
eventfd: Too many open files  
eventfd: Too many open …
Run Code Online (Sandbox Code Playgroud)

files ulimit

6
推荐指数
1
解决办法
1万
查看次数

从脚本运行时,ulimit -u 给出非法选项错误,但从终端运行时则不会

我有以下脚本:

#!/bin/sh
echo "OUTPUT:"
gcc temp.c
echo "ACTOP"
ulimit -t 1
ulimit -f 1024
ulimit -u 3
./a.out > out.txt
Run Code Online (Sandbox Code Playgroud)

我得到的输出是

OUTPUT: 
ACTOP 
ulimit: 7: Illegal option -u
Run Code Online (Sandbox Code Playgroud)

但是如果我ulimit -u 3直接在终端中使用它就可以了。然而,-t-f选项工作正常。

当我将shebang更改为#!/bin/bash可以工作时,但现在除非否,否则它拒绝执行代码。允许的进程数 > 132。任何小于 ulimit -u 132 的值都不允许执行。在终端中,我可以直接使用ulimit -u 3.

command-line bash ulimit

5
推荐指数
1
解决办法
4958
查看次数

为非 root 用户设置 ulimit

这是我的 elasticsearch 应用程序,它在启动时终止,显示:

bootstrap checks failed
[1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]
Run Code Online (Sandbox Code Playgroud)

我在我的 limits.conf 文件中进行了更改nofile以更改为 65536,如下所示:

*       soft    nofile  65536
*       hard    nofile  65536
Run Code Online (Sandbox Code Playgroud)

并为同一用户(非 root 用户)重新启动一个新会话,但是当我打开一个新会话时,我在终端上得到的第一件事是:

bash: ulimit: max user processes: cannot modify limit: Operation not permitted
Run Code Online (Sandbox Code Playgroud)

我的 ulimit 也没有改变。可能是什么原因?虽然我能够成功地为 root 用户更改它。

permissions ulimit 18.04

5
推荐指数
1
解决办法
1万
查看次数

在 ubuntu 12.04 上更改 ulimit 不起作用

我正在使用 hadoop 并且需要更改打开文件的数量ulimit -n。我在 stackoverflow 和其他地方看到过类似的问题,并尝试了这些答案中的所有内容,但仍然无效。我正在与ubuntu 12.04 LTS. 这是我所做的:

更改限制/etc/security/limits.conf,我已经为 * 和root. 我还更改了一些数字的限制,例如10000unlimited

* soft nofile 1513687
* hard nofile 1513687
root soft nofile 1513687
root hard nofile 1513687
Run Code Online (Sandbox Code Playgroud)

我也试过上面的设置-而不是softhard。在这些更改之后,我对/etc/pam.d/文件进行了更改,例如:

common-session 
common-session-noninterative
login
cron
sshd
su
sudo
Run Code Online (Sandbox Code Playgroud)

我已经添加session required pam_limits.so到每个文件的开头。我重新启动了有问题的盒子,但设置没有生效。

我还发现/etc/security/limits.d/用户hbase mapredhdfs. 我也尝试更改这些单个文件中的限制,但无济于事。

我也试过放在ulimit -S -n unlimited里面/etc/profile。这没用。

最后,我尝试将 …

hadoop 12.04 ulimit

4
推荐指数
1
解决办法
1万
查看次数

复制应用程序错误:“打开文件的 ulimit 级别太低,请提高它,否则将无法正确检测更改”

使用Copy 时,出现此错误:

Error: "The open file ulimit level is too low, please increase it otherwise changes will not be detected properly"
Run Code Online (Sandbox Code Playgroud)

应用程序在出现时停止同步,为什么以及如何修复它?

ulimit copy.com

4
推荐指数
1
解决办法
2857
查看次数