Blog-Archiv

Montag, 4. Januar 2021

Accelerate LINUX Boot by Disabling Unneeded Services

My Ubuntu 20.04 LINUX takes about 70 seconds to boot on my 4 x 1.70 GHz cores laptop with 8 GB memory. This is much slower than WINDOWS, so I wondered if I can make this faster. On the web I found some useful commands. (I summarize them here in case I will need them again - that's what Blogs are for !-)

Finding out how much time every service startup took:

systemd-analyze blame

Parts of the output:

34.526s postgresql@9.3-main.service
34.086s snapd.service
33.170s postgresql@12-main.service
33.078s postgresql@9.5-main.service
33.024s postgresql@10-main.service
24.547s docker.service
....

Postgreslq database needed 34 seconds startup time, Snap 34, Docker 25. Docker and Snap are deployment tools that I don't use, Postgres I use rarely for testing JPA functionality. Although these startups are done in background, why do them on boot?

Displaying all services and their status:

service --status-all

This gives you a list of all service names, either running [ + ] or stopped [ - ]. These names you can use to manage the services:

 ....
 [ + ]  docker
 ....
 [ + ]  postgresql
 ....

Surprisingly Snap was not in this list .... looks like this is not so easy to get rid of. You can list your applications depending on Snap using this command:

snap list

Chromium, Gimp and Ksnip may be in this list, so better don't uninstall this!

Here are the commands to stop and disable a service (example for docker):

sudo systemctl stop docker
sudo systemctl disable docker

Other disable-candidates would be cups (a print-service, in case you don't use printers) and brltty ("Braille teletyper", console support for blind people), but I couldn't find their startup time in output of systemd-analyze blame, so it may not matter.

If I ever will need postgres again, I can launch these commands:

sudo systemctl enable postgresql
sudo systemctl start postgresql

Query the status of a specific service (example for snapd):

service snapd status



Keine Kommentare: