Re: Query on s6-log and s6-supervise

From: Colin Booth <colin_at_heliocat.net>
Date: Wed, 9 Jun 2021 08:32:46 +0000

On Wed, Jun 09, 2021 at 09:00:38AM +0530, Arjun D R wrote:
> Thanks Laurent for the brief detail. That really helps.
>
> I have checked the Private_Dirty memory in "smaps" of a s6-supervise
> process and I don't see any consuming above 8kB. Just posting it here
> for reference.
>
> grep Private_Dirty /proc/991/smaps
> Private_Dirty: 0 kB
> Private_Dirty: 4 kB
> Private_Dirty: 4 kB
> Private_Dirty: 8 kB
> Private_Dirty: 0 kB
> Private_Dirty: 0 kB
> Private_Dirty: 4 kB
> Private_Dirty: 4 kB
> Private_Dirty: 4 kB
> Private_Dirty: 0 kB
> Private_Dirty: 0 kB
> Private_Dirty: 4 kB
> Private_Dirty: 4 kB
> Private_Dirty: 0 kB
> Private_Dirty: 0 kB
> Private_Dirty: 8 kB
> Private_Dirty: 8 kB
> Private_Dirty: 8 kB
> Private_Dirty: 0 kB
> Private_Dirty: 0 kB
> Private_Dirty: 8 kB
> Private_Dirty: 4 kB
> Private_Dirty: 4 kB
> Private_Dirty: 0 kB
> Private_Dirty: 8 kB
> Private_Dirty: 4 kB
> Private_Dirty: 4 kB
> Private_Dirty: 4 kB
> Private_Dirty: 0 kB
> Private_Dirty: 0 kB
>
... snip...
In a fully dynamic world a large number of dirty pages is expected, even
if each segment is only one or two pages. There's nothing particularly
surprising here when using a distro provided s6 that's linked
dynamically.

>
> I have tried with flag "--enable-allstatic" and unfortunately I don't see
> any improvement. If you were mentioning about shared memory, then yes we
> are good here. It is using 2.1 MiB for 129 instances, but the private
> memory is around 12.2 MiB. I am not sure whether this is the normal value
> or not.
>
If you're building against glibc then allstatic probably won't help. The
default config options for s6 will build with static links against all
libraries but the libc which is a pretty decent tradeoff between
efficiency and convenience, but to see super low dirty memory you'll
need to use a libc that can actually be linked statically such as musl.

For your needs, using a musl toolchain and building a fully static s6
should get you significantly better memory usage.
-- 
Colin Booth
Received on Wed Jun 09 2021 - 10:32:46 CEST

This archive was generated by hypermail 2.4.0 : Wed Jun 09 2021 - 10:33:17 CEST