gpt4 book ai didi

Linux fork () : resource temporary unavavailable

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:53:39 25 4
gpt4 key购买 nike

如何调试以下几点才能找出资源超出限制的确切原因

  • 当前有多少进程在运行
  • 每运行多少个进程
  • 用户每个进程打开的文件数。
  • 总人数所有进程的打开文件数。
  • 没有。进程数限制 打开文件数限制

最佳答案

可以有多种方法来实现您想要实现的目标,例如您可以通过评估/proc/fs 获得所需的所有信息。以下是可用于调试实际资源问题的实用程序列表。祝你好运。

How many process currently running

ps-eaf | wc -l <​​/p>

How many process running for per user

ps -fu [用户名] | wc -l

No. of opened files for per process.

lsof -p | wc -l <​​/p>

Total no. of opened files for all process.

您可以如上所示遍历所有 pid 并使用 lsof 命令。在这里,您可能必须以 root 身份执行命令,否则在执行 lsof 时您将获得被拒绝的权限

No. of process limit No. of open file limit

对于特定的终端,你可以这样做

$ ulimit -a

core file size (blocks, -c) unlimited
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 15973
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) 15973
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited

关于Linux fork () : resource temporary unavavailable,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28666616/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com