#48864 util_info_sys_pages should be able to detect memory restrictions in a cgroup
Closed: wontfix 6 years ago Opened 7 years ago by firstyear.

In a container, or in systemd it's possible to have memory limits imposed by cgroups. Sadly, these are not exposed via getrlimit, or in meminfo. Apparently they have their own api and locations.

For more see:

https://fabiokung.com/2014/03/13/memory-inside-linux-containers/
https://www.freedesktop.org/software/systemd/man/systemd.resource-control.html

It's likely Directory Server will be run in one of these conditions. We should make sure that util_info_sys_pages can detect this correctly so we can make a correct assesment of cache checking.


Per weekly meeting, setting the milestone to 1.3.6.

William, if it is needed earlier than that, please feel free to update it. Thanks!

Might be possible with

{{{
/sys/fs/cgroup/memory/memory.limit_in_bytes
/sys/fs/cgroup/memory/memory.soft_limit_in_bytes
}}}

Metadata Update from @firstyear:
- Issue assigned to firstyear
- Issue set to the milestone: 1.3.6.0

7 years ago

Metadata Update from @firstyear:
- Custom field reviewstatus adjusted to new
- Issue close_status updated to: None

7 years ago

This cleans up our memory detection code before we add the cgroup detection.

Metadata Update from @firstyear:
- Custom field reviewstatus adjusted to review (was: new)

7 years ago

Metadata Update from @mreynolds:
- Custom field reviewstatus adjusted to ack (was: review)

7 years ago

commit d7ea586
commit 0550cea
To ssh://git@pagure.io/389-ds-base.git
fcfe4e4..0550cea master -> master

Metadata Update from @firstyear:
- Custom field reviewstatus adjusted to review (was: ack)

7 years ago

Basic tests pass with this patch, in a container with a 1GB memory limit.

Looks good, even the indentation ;-)

Metadata Update from @mreynolds:
- Custom field reviewstatus adjusted to ack (was: review)

7 years ago

Thanks mate, spent a lot of time aligning all the bits :)

commit a96f833

Metadata Update from @firstyear:
- Issue close_status updated to: fixed
- Issue status updated to: Closed (was: Open)

7 years ago

Metadata Update from @mreynolds:
- Custom field rhbz adjusted to https://bugzilla.redhat.com/show_bug.cgi?id=1443682

7 years ago

Metadata Update from @mreynolds:
- Custom field rhbz adjusted to https://bugzilla.redhat.com/show_bug.cgi?id=1443682

7 years ago

Metadata Update from @vashirov:
- Custom field reviewstatus adjusted to review (was: ack)
- Issue status updated to: Open (was: Closed)

6 years ago

Metadata Update from @mreynolds:
- Custom field reviewstatus adjusted to ack (was: review)

6 years ago

Thank you, Mark!

To ssh://pagure.io/389-ds-base.git
9327a99..e659e32 master -> master
910a4ce..9563d29 389-ds-base-1.3.6 -> 389-ds-base-1.3.6

Metadata Update from @vashirov:
- Issue assigned to vashirov (was: firstyear)

6 years ago

Metadata Update from @vashirov:
- Issue assigned to firstyear (was: vashirov)
- Issue close_status updated to: fixed
- Issue status updated to: Closed (was: Open)

6 years ago

I think we need to tweak this slight, because config.h needs to not be in slapi_pal.h. I'll make a follow up for this.

Metadata Update from @firstyear:
- Custom field reviewstatus adjusted to review (was: ack)
- Issue status updated to: Open (was: Closed)

6 years ago

@firstyear I have no objections. slapi-nis builds (and freeipa too).

This patch generates compiler warnings:

In file included from ../389-ds-base/ldap/servers/slapd/slapi-private.h:11:0,
                 from ../389-ds-base/ldap/servers/slapd/slapi_pal.c:17:
./config.h:358:0: warning: "LINUX" redefined
 #define LINUX 1

In file included from /usr/include/nspr4/prtypes.h:26:0,
                 from ../389-ds-base/ldap/servers/slapd/slapi-plugin.h:33,
                 from ../389-ds-base/ldap/servers/slapd/slapi_pal.c:15:
/usr/include/nspr4/prcpucfg.h:19:0: note: this is the location of the previous definition
 #define LINUX

This is because we included both slapi-plugin and slapi-private header files, but slapi-private already calls slapi-plugin. Its a minor fix that I'll include in the commit

This patch generates compiler warnings:

In file included from ../389-ds-base/ldap/servers/slapd/slapi-private.h:11:0,
                 from ../389-ds-base/ldap/servers/slapd/slapi_pal.c:17:
./config.h:358:0: warning: "LINUX" redefined
 #define LINUX 1

In file included from /usr/include/nspr4/prtypes.h:26:0,
                 from ../389-ds-base/ldap/servers/slapd/slapi-plugin.h:33,
                 from ../389-ds-base/ldap/servers/slapd/slapi_pal.c:15:
/usr/include/nspr4/prcpucfg.h:19:0: note: this is the location of the previous definition
 #define LINUX

This is because we included both slapi-plugin and slapi-private header files, but slapi-private already calls slapi-plugin. Its a minor fix that I'll include in the commit

f913252..adb18fa master -> master

da751b8..e392712 389-ds-base-1.3.6 -> 389-ds-base-1.3.6

Another option is we should set #pragma once in slapi-plugin and slapi-private.

Metadata Update from @mreynolds:
- Issue close_status updated to: fixed
- Issue status updated to: Closed (was: Open)

6 years ago

389-ds-base is moving from Pagure to Github. This means that new issues and pull requests
will be accepted only in 389-ds-base's github repository.

This issue has been cloned to Github and is available here:
- https://github.com/389ds/389-ds-base/issues/1924

If you want to receive further updates on the issue, please navigate to the github issue
and click on subscribe button.

Thank you for understanding. We apologize for all inconvenience.

Metadata Update from @spichugi:
- Issue close_status updated to: wontfix (was: fixed)

3 years ago

Login to comment on this ticket.