限制Linux中用户可用的内存和CPU

时间:2022-03-06 16:56:32

I am a little concerned with the amount of resources that I can use in a shared machine. Is there any way to test if the administrator has a limit in the amount of resources that I can use? And if does, to make a more complete question, how can I set up such limit?

我有点担心我可以在共享机器中使用的资源量。有没有办法测试管理员是否有我可以使用的资源量限制?如果是,为了提出更完整的问题,我该如何设置这样的限制?

Thank you.

谢谢。

2 个解决方案

#1


15  

For process related limits, you can have a look in /etc/security/limits.conf (read the comments in the file, use google or use man limits.conf for more information). And as jpalecek points out, you may use ulimit -a to see (and possibly modify) all such limits currently in effect.

有关与流程相关的限制,您可以查看/etc/security/limits.conf(阅读文件中的注释,使用google或使用man limits.conf获取更多信息)。正如jpalecek指出的那样,你可以使用ulimit -a来查看(并可能修改)当前有效的所有限制。

You can use the command quota to see if a disk quota is in effect.

您可以使用命令quota来查看磁盘配额是否有效。

#2


7  

You can try running

你可以尝试跑步

ulimit -a

to see what resource limits are in effect. Also, if you are allowed to change such limits, you can change them by the ulimit command, eg.

查看有效的资源限制。此外,如果允许更改此类限制,则可以通过ulimit命令更改它们,例如。

ulimit -c unlimited

lifts any limit for a size of a core file a process can make.

提升进程可以进行的核心文件大小的任何限制。

#1


15  

For process related limits, you can have a look in /etc/security/limits.conf (read the comments in the file, use google or use man limits.conf for more information). And as jpalecek points out, you may use ulimit -a to see (and possibly modify) all such limits currently in effect.

有关与流程相关的限制,您可以查看/etc/security/limits.conf(阅读文件中的注释,使用google或使用man limits.conf获取更多信息)。正如jpalecek指出的那样,你可以使用ulimit -a来查看(并可能修改)当前有效的所有限制。

You can use the command quota to see if a disk quota is in effect.

您可以使用命令quota来查看磁盘配额是否有效。

#2


7  

You can try running

你可以尝试跑步

ulimit -a

to see what resource limits are in effect. Also, if you are allowed to change such limits, you can change them by the ulimit command, eg.

查看有效的资源限制。此外,如果允许更改此类限制,则可以通过ulimit命令更改它们,例如。

ulimit -c unlimited

lifts any limit for a size of a core file a process can make.

提升进程可以进行的核心文件大小的任何限制。