默认的最大锁定内存值来自哪里?

发布于 2024-09-24 17:19:37 字数 669 浏览 8 评论 0原文

因此,在一个系统上,我的值非常开放:

$ 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

时光礼记 2024-10-01 17:19:37

如果您尝试的用户粒度设置不起作用,您应该确保您已正确匹配达到限制的用户。

您还应该能够将这样的行添加到limits.conf:

* hard memlock 40000

这将更改所有用户的默认设置。

来自 limit.conf 联机帮助页:

The syntax of the lines is as follows:

<domain> <type> <item> <value>

The fields listed above should be filled as follows:

<domain>

[snip]
·   the wildcard *, for default entry.

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:

* hard memlock 40000

That'll change the default setting for all users.

From the limits.conf manpage:

The syntax of the lines is as follows:

<domain> <type> <item> <value>

The fields listed above should be filled as follows:

<domain>

[snip]
·   the wildcard *, for default entry.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文