Announcement

Collapse
No announcement yet.

Which services are safe to disable

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [DESKTOP] Which services are safe to disable

    I'm system is running good as a home desktop. However, I'd like to make it faster to boot. Have look at the services and suggest me which ones are safe to disable.
    Code:
    systemd-analyze blame | nl 
        1  220ms home-manmath-windows.mount
        2  217ms systemd-resolved.service
        3  193ms dev-sdb1.device
        4  141ms udisks2.service
        5  108ms NetworkManager.service
        6   74ms systemd-logind.service
        7   73ms wpa_supplicant.service
        8   70ms user@1000.service
        9   56ms keyboard-setup.service
       10   52ms systemd-udev-trigger.service
       11   45ms systemd-udevd.service
       12   38ms systemd-timesyncd.service
       13   37ms systemd-journald.service
       14   34ms upower.service
       15   18ms systemd-tmpfiles-setup.service
       16   17ms systemd-sysusers.service
       17   11ms polkit.service
       18   10ms systemd-sysctl.service
       19    9ms systemd-update-utmp.service
       20    8ms systemd-tmpfiles-setup-dev.service
       21    7ms sys-kernel-config.mount
       22    7ms systemd-remount-fs.service
       23    7ms systemd-rfkill.service
       24    6ms systemd-modules-load.service
       25    5ms user-runtime-dir@1000.service
       26    5ms systemd-update-utmp-runlevel.service
       27    4ms sddm.service
       28    3ms systemd-journal-flush.service
       29    3ms console-setup.service
       30    3ms kmod-static-nodes.service
       31    3ms systemd-user-sessions.service
    Last edited by Snowhog; Aug 13, 2022, 06:57 AM.

    #2
    You could research all those services by name, but at a quick glance, all of them look important, but there may be things you personally don't need? I can't say. Your output looks pretty fast already, for the items shown.

    systemd-resolved.service, for example. Most of these probably have man pages, like this one does.


    Do remember that the times shown are not consecutive, as the boot process loads many things in parallel. So removing something that takes 100 ms does not shave 100 ms from the overall boot time.

    A better picture is seen when looking at all the systemd-analye info:

    systemd-analyze to see times from the complete boot process, including the bios/firmware loading and grub waiting for user input or timing out
    here is mine, from this morning:
    Code:
    $ systemd-analyze  
    Startup finished in 15.728s (firmware) + 5.768s (loader) + 4.851s (kernel) + 1.913s (userspace) = 28.262s
    My PC boots automatically at my specified time. I could save almost 6 seconds if I hide/skip the grub menu as I do not dual boot this system. I have not been able to reduce my firmware loading time, which is taking more than half the total boot time, but is still an area that one can look at. Some BIOS have quick boot settings to speed that part up a little.

    systemd-analyze blame

    And particularly:
    systemd-analyze critical-chain, which can help show what services might be holding back others from starting. This is probably where you can find the most useful info. One common place that can slow things is networking and remote mounts. But I am guessing from your times that this probably is not an issue here. but critical-chain would show this info a bit better, if it is.
    Last edited by claydoh; Aug 13, 2022, 07:09 AM.

    Comment


      #3
      Claydoh, thanks for your explanation. Seems all are important and it's not good to disable any. However, here's the critical-chain result:
      Code:
      manmath@manmath-H61M-DS2:~$ systemd-analyze critical-chain
      The time when unit became active or started is printed after the "@" character.
      The time the unit took to start is printed after the "+" character.
      
      graphical.target @2.510s
      └─udisks2.service @2.369s +140ms
       └─basic.target @2.363s
         └─sockets.target @2.363s
           └─uuidd.socket @2.363s
             └─sysinit.target @2.360s
               └─systemd-resolved.service @2.145s +215ms
                 └─systemd-tmpfiles-setup.service @2.122s +16ms
                   └─local-fs.target @2.120s
                     └─home-manmath-windows.mount @1.913s +207ms
                       └─dev-sda1.device @1.908s
      Last edited by manmath; Aug 15, 2022, 07:13 PM.

      Comment


        #4
        And? these times are quite fast.

        Code:
        graphical.target @2.510s
        It is taking 2.5 seconds from the login screen to the desktop. Spiffy!

        What is just systemd-analyze saying? What is making you think it can be sped up more?

        Comment


          #5
          Code:
          manmath@manmath-H61M-DS2:~$ systemd-analyze
          Startup finished in 1.002s (kernel) + 967ms (userspace) = 1.970s  
          graphical.target reached after 956ms in userspace.
          Code:
          manmath@manmath-H61M-DS2:~$ systemd-analyze critical-chain
          The time when unit became active or started is printed after the "@" character.
          The time the unit took to start is printed after the "+" character.
          
          graphical.target @956ms
          └─udisks2.service @812ms +144ms
           └─basic.target @806ms
             └─sockets.target @806ms
               └─uuidd.socket @806ms
                 └─sysinit.target @803ms
                   └─systemd-resolved.service @584ms +218ms
                     └─systemd-tmpfiles-setup.service @563ms +18ms
                       └─local-fs.target @561ms
                         └─home-manmath-windows.mount @342ms +219ms
                           └─dev-sda1.device @339ms
          Why does the boot time change every time. Previously (critical-chain) it was some 2.5 sec, now it's some 1 sec. Is there anything wrong in the services? I mean reaching the graphical target has always been < 3 sec, but never consistent. Also suggest what services can still be disabled without compromising the home desktop setup.
          Last edited by manmath; Aug 16, 2022, 02:44 AM.

          Comment


            #6
            Some things don't occur every boot, particularly file system checks, trims, and other things of that nature. . Sometimes the network connects a little faster or slower, depending on traffic at the router, things lie, that.

            Originally posted by manmath View Post
            Also suggest what services can still be disabled without compromising the home desktop setup
            I don't really know. I'd have to search for each individual service, see what it does, and decide if it is useful or not, for you. I can't really do that very well, as only you can make that sort of decision.

            I do know that much work an effort has been put into speeding up boot times in Linux over the past decade or more, and I do make the assumption that all the services running during boot are more or less necessary, and as minimal as needed. Sure, you can disable Bluetooth if you don't use that, for example, of course.

            There are some items in System Settings for startup items that you might try disabling, and they have good descriptions of what they dom but I don't think these will effect the bootup times, as they are user level items. But might be worth looking at.

            Comment


              #7
              Thanks, for your suggestion. As you rightly told, it's often due to router and periodically due to trim. I tried to disable/tweak some services but the result became undesirable. I believe 31 services that are running on my system after boot is optimal, I should keep it this way. BTW, I really like Kubuntu this time. It took me some time to fully optimize the desktop with just enough packages and I find the experience quite snappier.

              Comment

              Working...
              X