[systemd-devel] Reduce unit-loading time
lennart at poettering.net
Wed May 13 09:04:06 PDT 2015
On Wed, 13.05.15 17:51, cee1 (fykcee1 at gmail.com) wrote:
> Hi all,
> We're trying systemd to boot up an ARM board, and find systemd uses
> more than one second to load units.
> Comparing with the init of Android on the same board, it manages to
> boot the system very fast.
> We guess following factors are involved:
> 1. systemd has a much bigger footprint than the init of Android: the
> latter is static linked, and is about 1xxKB (systemd is about 1.4MB,
> and is linked with libc/libcap/libpthread, etc)
> 2. systemd spends quiet a while to read/parse unit files.
> Any idea to reduce the unit-loading time?
> e.g. one-single file contains all units descriptions, or a "compiled
> version"(containing resolved dependencies, or even the boot up
Well, before starting to optimize things one should always profile
this step to identify what precisely is slow. This starts from
questions like whether this is IO bound or CPU bound to precisely
tracing things down to individual files.
systemd unit loading is not particularly optimized, we distribute
everything into small unit files, which generally isn't the best way
to get quick access times for many file systems. You can improve the
situation with read-ahead for these files, but before you do that you
really need to spend some time to figure out what precisely is slow.
Lennart Poettering, Red Hat
More information about the systemd-devel