Mar
16
[原] bash 下修改 ulimit 的 pipe size 报错
用 python subprocess 捕获命令行输出结果失去响应,怀疑是 pipe size 太小,尝试修改。
但报错:
默认值:
修改:
排查了一下,发现网上的资料都是错的,一堆的都是 ksh 的修改。实际上,bash 中这个值是不能改的。
见:
bash: ulimit: pipe size: cannot modify limit: Invalid argument
但报错:
# ulimit -p 16
-bash: ulimit: pipe size: cannot modify limit: Invalid argument
-bash: ulimit: pipe size: cannot modify limit: Invalid argument
默认值:
引用
# 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) 14848
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) 10240
cpu time (seconds, -t) unlimited
max user processes (-u) 14848
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 14848
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) 10240
cpu time (seconds, -t) unlimited
max user processes (-u) 14848
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
修改:
# ulimit -p 16
-bash: ulimit: pipe size: cannot modify limit: Invalid argument
-bash: ulimit: pipe size: cannot modify limit: Invalid argument
排查了一下,发现网上的资料都是错的,一堆的都是 ksh 的修改。实际上,bash 中这个值是不能改的。
见:
bash: ulimit: pipe size: cannot modify limit: Invalid argument
引用
Getting this error because this is not an adjustable parameter.
Refer the manual page for ulimit:
-p The pipe size in 512-byte blocks (this may not be set)
This value can not set. You would probably need to recompile the kernel after changing a header file to alter this value, which is not feasible.
Refer the manual page for ulimit:
-p The pipe size in 512-byte blocks (this may not be set)
This value can not set. You would probably need to recompile the kernel after changing a header file to alter this value, which is not feasible.
广州律师
2020/11/30 16:09
发现网上的资料都是错的
分页: 1/1 1