免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12下一页
最近访问板块 发新帖
查看: 3353 | 回复: 10
打印 上一主题 下一主题

linux内存占用 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-01-08 08:30 |只看该作者 |倒序浏览
centos有没有办法实现让root有固定大小的内存使用
就是说其他用户的程序再大都不会把内存占用完,方便root用户维护,
有没有办法实现? 请各位高手指教

论坛徽章:
0
2 [报告]
发表于 2009-01-08 08:36 |只看该作者
没听说过linux有内存配额限制的

论坛徽章:
0
3 [报告]
发表于 2009-01-08 10:10 |只看该作者
如果有的话我也想知道。

论坛徽章:
0
4 [报告]
发表于 2009-01-08 10:13 |只看该作者
其实可以每个用户划个虚拟机给他
用KVM倒可以的
这样虽然每个用户都是跑在虚拟机里但是感觉上还是在物理机器上一样

论坛徽章:
0
5 [报告]
发表于 2009-01-08 10:32 |只看该作者
想法不错,等待。。。

论坛徽章:
0
6 [报告]
发表于 2009-01-08 10:40 |只看该作者
可以,不过只针对用户,你看看如下

vi /etc/security/limits.conf
# /etc/security/limits.conf
#
#Each line describes a limit for a user in the form:
#
#<domain>        <type>  <item>  <value>
#
#Where:
#<domain> can be:
#        - an user name
#        - a group name, with @group syntax
#        - the wildcard *, for default entry
#        - the wildcard %, can be also used with %group syntax,
#                 for maxlogin limit
#
#<type> can have the two values:
#        - "soft" for enforcing the soft limits
#        - "hard" for enforcing hard limits
#
#<item> can be one of the following:
#        - core - limits the core file size (KB)
#        - data - max data size (KB)
#        - fsize - maximum filesize (KB)
#        - memlock - max locked-in-memory address space (KB)
#        - nofile - max number of open files
#        - rss - max resident set size (KB)
#        - stack - max stack size (KB)
#        - cpu - max CPU time (MIN)
#        - nproc - max number of processes
#        - as - address space limit
#        - maxlogins - max number of logins for this user
#        - maxsyslogins - max number of logins on the system
#        - priority - the priority to run user process with
#        - locks - max number of file locks the user can hold
#        - sigpending - max number of pending signals
#        - msgqueue - max memory used by POSIX message queues (bytes)
#        - nice - max nice priority allowed to raise to
#        - rtprio - max realtime priority
#
#<domain>      <type>  <item>         <value>
#

#*               soft    core            0
#*               hard    rss             10000
#@student        hard    nproc           20
#@faculty        soft    nproc           20
#@faculty        hard    nproc           50
#ftp             hard    nproc           0
#@student        -       maxlogins       4

论坛徽章:
0
7 [报告]
发表于 2009-01-08 12:28 |只看该作者
unlimit,这个试一下

论坛徽章:
0
8 [报告]
发表于 2009-01-09 01:16 |只看该作者
好像不行吧。
建议还是加大内存吧

论坛徽章:
0
9 [报告]
发表于 2009-01-09 08:55 |只看该作者

回复 #1 yffl1987 的帖子

可以通过limit做一些硬限制

论坛徽章:
5
寅虎
日期:2015-01-20 09:16:52亥猪
日期:2015-01-21 14:43:44IT运维版块每日发帖之星
日期:2015-12-17 06:20:00每日论坛发贴之星
日期:2015-12-17 06:20:00每周论坛发贴之星
日期:2015-12-20 22:22:00
10 [报告]
发表于 2009-01-09 17:03 |只看该作者
原帖由 luo118 于 2009-1-8 10:40 发表
可以,不过只针对用户,你看看如下

vi /etc/security/limits.conf
# /etc/security/limits.conf
#
#Each line describes a limit for a user in the form:
#
#            
#
#Where:
# can be:
...

学习了
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP