You are not logged in.

#1 2018-09-13 15:58:12

mapcode.mind
Member
Registered: 2018-09-13
Posts: 2

creating a boot-time optimization script

hey guys,

I've been thinking about writing a shell script to optimize the boot-time (or time for kernel space + user space + graphical target). I've figured out that the display managers (Graphical ones) usually take some time to load the desktop environment. This time can be utilized to load some services (which are not base services) like bluetooth, thermald, docker etc  on login.

I can sift through the `systemd` services to find out which ones are not `RequiredBy` any other service, and takes a long time to load (a threshold would have to be specified). Then i can disable these services and create  a shell script to be executed on login, which would start these services.

I'm looking for comments on this idea. are there any security implications? etc.

Thanks.

Offline

#2 2018-09-13 16:13:27

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 5,268

Re: creating a boot-time optimization script

One of the major benefits of systemd  is that it does all of that, correctly and quickly already, what do you expect to gain?

When you reach the "slow" display manager service, all the other ones you mention will have already started.

I suspect an XY problem, what actual issue do you see and what do you think could be optimized? Have you already checked the output of

systemd-analyze blame
systemd-analyze critical-chain

Last edited by V1del (2018-09-13 16:23:28)

Offline

#3 2018-09-13 17:13:45

mapcode.mind
Member
Registered: 2018-09-13
Posts: 2

Re: creating a boot-time optimization script

V1del wrote:

One of the major benefits of systemd  is that it does all of that, correctly and quickly already, what do you expect to gain?

When you reach the "slow" display manager service, all the other ones you mention will have already started.

I suspect an XY problem, what actual issue do you see and what do you think could be optimized? Have you already checked the output of

systemd-analyze blame
systemd-analyze critical-chain

My goal is to have a system that gives me a desktop environment in as little time as possible. I stumbled upon this idea - taking care of on-boot services -  to achieve that goal.

i have read that systemd parallelizes resource initialization by creating auxiliary units. But, despite that the boot-time in my case was usually over 32 seconds (i have a spinning hdd). I did  a `systemd-analyze blame` and `systemd-analyze critical-chain` to find out that somehow `ModemManager.service` was taking 12-15 seconds to load. I disabled it, and wrote a login script to start that service on login. And my boot time actually went down to 23 seconds something.  A gain of 9 seconds!

And thank you for that link, i'd be careful of avoiding the XYProblem in future. Thanks again.

Last edited by mapcode.mind (2018-09-13 17:15:26)

Offline

Board footer

Powered by FluxBB