[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: A few observations about systemd



On Tue, 19 Jul 2011, Matthias Klumpp <matthias@nlinux.org> wrote:
> I spoke with Lennart Poettering about this thread on IRC, and he asked me
> 
> to forward some clarifications about systemd to this list:
> >><<
> 
> i found while reading through that thread
> 
>  a) the main memory usage by systemd is actually the selinux policy we
> load in to memory so that we can tag sockets properly
>     so the big memory consumption is the price you pay for selinux, not
> really for systemd

root         1  7.9  1.4  41828  7588 ?        Ss   00:42   0:01 /bin/systemd

On an AMD64 KVM instance running SE Linux I see the above in ps output.  When 
I boot the same instance with "selinux=0" I see the below:

root         1  9.3  0.7  38236  3868 ?        Ss   00:43   0:01 /bin/systemd

It seems that the additional memory use for SE Linux is 3592K used and 3720K 
resident.

On an AMD64 system that means the SE Linux memory overhead in systemd is 8.5% 
of used memory and 49% of resident memory.  While 49% of total resident size 
sounds like a lot, 4M isn't much memory on a remotely modern system.  Of 
course this depends on which policy modules are loaded.

>     systemd will use more memory than sysvinit however
>     though if you then subtract the memory for inetd and so on, it will
> probably comapre not too bad.
>     (!My Note: systemd can *of course* be used without SELinux)
>     the selinux policy issue is probably something we can improve, by
> loading the policy only partially.

Yes, I've just spent as much time browsing the systemd code as I'm willing to 
do late at night.  It seems that there is room for improvement based on what I 
observe (the RAM usage is a lot bigger than /etc/selinux) but reading the code 
I can't see anything obvious or easy.

We should be able to cache the things we need and discard the rest with a 
result of only a few K of data used (and maybe 100K of extra code paged in).

>  b) systemd is very much suitable for the embedded area, that's why meego
> switched to it, and it is available in a couple of embedded distributions
>     and, i am sure that those embedded distros are much better choices for
> embedded devices, then debian is. with other words: systemd should cover
> the full range of debian. (!My Note: I showed him http://emdebian.org -
> "embedded devices" means only really small devices here, the whole mobile
> stuff is of course covered)

http://doc.coker.com.au/papers/porting-se-linux-hand-held-devices/

As an aside in 2003 I wrote a paper about porting SE Linux to the iPaQ which 
had 64M of RAM and 48M of storage.  One of my clients does some embedded stuff 
nowadays, the smallest motherboards that their suppliers offer have 128M of 
RAM soldered on (and something a lot greater than 48M of storage).

The overhead of systemd on modern embedded systems is a lot less than the 
overhead of some of the things we were doing 8 years ago as a fraction of 
system resources.

-- 
My Main Blog         http://etbe.coker.com.au/
My Documents Blog    http://doc.coker.com.au/


Reply to: