这是输出 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) 我正在尝试为 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) 您如何ulimit -u在 Ubuntu 中永久设置每个用户 ( ) 的进程限制?
? 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) 我正在尝试运行一个 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) 当我打开 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) 我有以下脚本:
#!/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.
这是我的 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 用户更改它。
我正在使用 hadoop 并且需要更改打开文件的数量ulimit -n。我在 stackoverflow 和其他地方看到过类似的问题,并尝试了这些答案中的所有内容,但仍然无效。我正在与ubuntu 12.04 LTS. 这是我所做的:
更改限制/etc/security/limits.conf,我已经为 * 和root. 我还更改了一些数字的限制,例如10000和unlimited。
* soft nofile 1513687
* hard nofile 1513687
root soft nofile 1513687
root hard nofile 1513687
Run Code Online (Sandbox Code Playgroud)
我也试过上面的设置-而不是soft和hard。在这些更改之后,我对/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 mapred和hdfs. 我也尝试更改这些单个文件中的限制,但无济于事。
我也试过放在ulimit -S -n unlimited里面/etc/profile。这没用。
最后,我尝试将 …
使用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 ×10
bash ×2
11.10 ×1
12.04 ×1
14.04 ×1
18.04 ×1
apache2 ×1
command-line ×1
copy.com ×1
files ×1
filesystem ×1
hadoop ×1
memory-usage ×1
permissions ×1
process ×1
redmine ×1
server ×1