默认的最大锁定内存值来自哪里?
因此,在一个系统上,我的值非常开放:
$ ulimit -a | grep mem
max locked memory (kbytes, -l) 40000
max memory size (kbytes, -m) unlimited
virtual memory (kbytes, -v) unlimited
另一个系统有更多的限制值,但我一生都无法找出 32MB 上限(尽管标签错误,但它是 32MB)的设置位置:
# ulimit -a | grep mem
max locked memory (kbytes, -l) 32
max memory size (kbytes, -m) unlimited
virtual memory (kbytes, -v) unlimited
第二个系统是 RHEL 5.5 盒子。我希望为至少一个用户增加此限制 - 我需要更大的 APC mmap 内存分配,但如果不达到上述限制,我就无法超过 30 MB,而且我宁愿不破解提供的 apache init 脚本。我应该在哪里尝试覆盖系统默认值,以便可以映射更大的内存段?在 apache 用户的 limit.conf 中执行此操作并没有多大作用;可能是因为 init 脚本不通过 PAM 执行任何操作。
So on one system, I have values that are pretty wide open:
$ ulimit -a | grep mem
max locked memory (kbytes, -l) 40000
max memory size (kbytes, -m) unlimited
virtual memory (kbytes, -v) unlimited
Another system has much more limiting values, but I can't for the life of me find out where the 32MB upper limit (it is 32MB despite the mislabling) is being set:
# ulimit -a | grep mem
max locked memory (kbytes, -l) 32
max memory size (kbytes, -m) unlimited
virtual memory (kbytes, -v) unlimited
The second system is a RHEL 5.5 box. I am looking to increase this limit for at least one user- I need a bigger APC mmap memory allocation, but I can't go above 30 MB without running into the above limit, and I would rather not hack the provided apache init script. Where should I be trying to override the system default value so I can map a bigger segment of memory? Doing it in limits.conf for the apache user doesn't do a whole lot; probably because the init script doesn't do anything through PAM.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您尝试的用户粒度设置不起作用,您应该确保您已正确匹配达到限制的用户。
您还应该能够将这样的行添加到limits.conf:
这将更改所有用户的默认设置。
来自 limit.conf 联机帮助页:
If the user granularity setting you tried isn't working, you should make sure that's you've correctly matched which user is hitting the limit.
You should also be able to add a line like this to limits.conf:
That'll change the default setting for all users.
From the limits.conf manpage: