![远程用户是否可以查询该用户所拥有的 RAM 和 CPU 容量](https://linux22.com/image/1615250/%E8%BF%9C%E7%A8%8B%E7%94%A8%E6%88%B7%E6%98%AF%E5%90%A6%E5%8F%AF%E4%BB%A5%E6%9F%A5%E8%AF%A2%E8%AF%A5%E7%94%A8%E6%88%B7%E6%89%80%E6%8B%A5%E6%9C%89%E7%9A%84%20RAM%20%E5%92%8C%20CPU%20%E5%AE%B9%E9%87%8F.png)
我有远程 Linux 服务器帐户。我可以使用 top 查看机器的总容量和使用情况,但整个资源不只属于我。我能以某种方式找出分配给我的 RAM 和 CPU 容量吗?
$ 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) 771915
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) 4096
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
答案1
您可以使用ulimit
命令(具体来说,ulimit -a
显示所有限制)来查找您的帐户的资源使用限制。例如,
$ 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) 60929
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 65536
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) 60929
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited