Announcement

Collapse
No announcement yet.

Long time after longin until the desktop is available

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

    [SOLVED] Long time after longin until the desktop is available

    After updating my system to Kubuntu 20.04 its needs a long time after login until the desktop is available.

    It is an 8 years old PC and I have updated Kubuntu from 12.04 for every LTS version since.

    There may be some issues from the multiple updates over the years or it is just slow on the now old PC.

    Any advice how o make it faster? Maybe some background task which could be switched off.

    Thanks in advance

    #2
    We can check a few things and see if a background service is slow, or waiting on something.


    Code:
    systemd-analyze
    then

    Code:
    systemd-analyze blame
    Which lists things in order of the length of time each thing took

    Then
    systemd-analyze critical-chain
    which will show a tree showing a bit more where things may be slow

    networking is a common culprit, for the past few years in my experiences, but it could be other items as well
    Hopefully these commands will show the bottleneck, which should be an easy fix.

    Comment


      #3
      Hello claydoh,

      thank you for the hints.
      systemd-analyze critical-chain delivers:

      graphical.target @1min 30.045s
      └─multi-user.target @1min 30.045s
      └─docker.service @53.816s +36.229s
      └─network-online.target @53.730s
      └─NetworkManager-wait-online.service @38.022s +15.707s
      └─NetworkManager.service @28.043s +9.975s
      └─dbus.service @28.041s
      └─basic.target @27.968s
      └─sockets.target @27.968s
      └─snapd.socket @27.966s +1ms
      └─sysinit.target @27.836s
      └─snapd.apparmor.service @27.196s +640ms
      └─apparmor.service @24.944s +2.230s
      └─local-fs.target @24.944s
      └─mnt-daten.mount @24.403s +540ms
      └─dev-sda4.device @24.377s

      Network may indeed be a problem, but what can I change?
      docker seems also to need much time. I do not need docker I could switch it off. Where?
      Attached Files

      Comment


        #4
        It is easier to paste the text output into a post, so we don't have to download files in order to view them


        if you don't use docker, you probably can uninstall it, don't think it is a normal, 'stock' *buntu program. I could be wrong, though.
        But:

        Code:
        systemctl disable docker.service
        systemctl disable docker.socket

        Comment


          #5
          I switched docker off and the output of systemd-analyze critical-chain looks better, but I still need more than 4 minutes until the desktop is available. This is much more than the 49s shown by the output. So maybe it is something happening later.

          Code:
          graphical.target @49.231s
          └─multi-user.target @49.231s
           └─minidlna.service @39.865s +9.365s
             └─remote-fs.target @39.694s
               └─mnt-fritz.mount @33.388s +6.305s
                 └─network-online.target @33.228s
                   └─NetworkManager-wait-online.service @29.473s +3.754s
                     └─NetworkManager.service @22.810s +6.660s
                       └─dbus.service @22.807s
                         └─basic.target @22.716s
                           └─sockets.target @22.716s
                             └─snapd.socket @22.715s +1ms
                               └─sysinit.target @22.619s
                                 └─snapd.apparmor.service @21.933s +685ms
                                   └─apparmor.service @20.067s +1.808s
                                     └─local-fs.target @20.067s
                                       └─mnt-daten.mount @19.178s +888ms
                                         └─dev-sda4.device @19.164s
          Code:
          17.736s udisks2.service                                                          
          15.458s dev-sda6.device                                                          
          14.962s snapd.service                                                            
          13.710s systemd-journal-flush.service                                            
          11.952s accounts-daemon.service                                                  
          11.455s networkd-dispatcher.service                                              
          9.365s minidlna.service                                                         
          7.326s packagekit.service                                                       
          6.660s NetworkManager.service                                                   
          6.482s avahi-daemon.service                                                     
          6.421s polkit.service                                                           
          6.305s mnt-fritz.mount                                                          
          6.168s dev-loop0.device                                                         
          6.128s dev-loop4.device                                                         
          5.980s dev-loop5.device                                                         
          5.926s dev-loop7.device                                                         
          5.907s dev-loop2.device                                                         
          5.723s dev-loop6.device                                                         
          5.685s thermald.service                                                         
          5.684s systemd-logind.service                                                   
          5.683s wpa_supplicant.service                                                   
          5.563s ModemManager.service                                                     
          5.123s dev-loop1.device                                                         
          4.801s dev-loop3.device                                                         
          3.754s NetworkManager-wait-online.service                                       
          3.280s gpu-manager.service                                                      
          2.670s systemd-resolved.service                                                 
          2.535s grub-common.service                                                      
          2.429s e2scrub_reap.service                                                     
          2.410s colord.service                                                           
          2.383s rsyslog.service                                                          
          2.356s grub-initrd-fallback.service                                             
          2.194s systemd-udevd.service                                                    
          2.168s networking.service                                                       
          1.996s rc.local.service                                                         
          1.808s apparmor.service                                                         
          1.789s keyboard-setup.service                                                   
          1.497s systemd-tmpfiles-setup.service                                           
          1.365s mnt-backup.mount                                                         
          1.364s gpsd.service                                                             
          1.082s ubuntu-fan.service                                                       
          1.060s systemd-sysusers.service                                                 
           981ms systemd-modules-load.service                                             
           888ms mnt-daten.mount                                                          
           868ms alsa-restore.service                                                     
           685ms snapd.apparmor.service                                                   
           637ms systemd-sysctl.service                                                   
           606ms systemd-tmpfiles-setup-dev.service                                       
           574ms systemd-random-seed.service                                              
           466ms binfmt-support.service                                                   
           421ms systemd-udev-trigger.service                                             
           402ms snapd.seeded.service                                                     
           358ms snap-core18-1932.mount                                                   
           327ms snap-chromium-1424.mount                                                 
           326ms snap-gtk\x2dcommon\x2dthemes-1506.mount                                  
           315ms snap-core18-1944.mount                                                   
           296ms ufw.service                                                              
           270ms pppd-dns.service                                                         
           265ms snap-gtk\x2dcommon\x2dthemes-1514.mount                                  
           239ms snap-gnome\x2d3\x2d28\x2d1804-145.mount                                  
           238ms upower.service                                                           
           231ms containerd.service                                                       
           210ms ifupdown-pre.service                                                     
           209ms kerneloops.service                                                       
           195ms apport.service                                                           
           195ms openvpn.service                                                          
           188ms systemd-timesyncd.service                                                
           180ms resolvconf-pull-resolved.service                                         
           180ms systemd-remount-fs.service                                               
           175ms atd.service                                                              
           172ms systemd-journald.service                                                 
           168ms snap-snapd-10492.mount                                                   
           167ms dev-hugepages.mount                                                      
           167ms dev-mqueue.mount                                                         
           166ms sys-kernel-debug.mount                                                   
           165ms sys-kernel-tracing.mount                                                 
           163ms kmod-static-nodes.service                                                
           159ms snap-snapd-10707.mount                                                   
           152ms plymouth-quit.service                                                    
           149ms orthanc.service                                                          
           146ms sddm.service                                                             
           131ms dev-disk-by\x2duuid-62e19622\x2db12e\x2d4e38\x2d8ec7\x2de5d0c8a9da81.swap
           128ms systemd-update-utmp.service                                              
           125ms dcmqrscp.service                                                         
           118ms dns-clean.service                                                        
            94ms systemd-user-sessions.service                                            
            93ms proc-sys-fs-binfmt_misc.mount                                            
            90ms storescp.service                                                         
            88ms user@1000.service                                                        
            71ms plymouth-read-write.service                                              
            65ms console-setup.service                                                    
            38ms setvtrgb.service                                                         
            14ms lightdm.service                                                          
            14ms plymouth-start.service                                                   
            11ms user-runtime-dir@1000.service                                            
             8ms ureadahead-stop.service                                                  
             7ms systemd-update-utmp-runlevel.service                                     
             5ms rtkit-daemon.service                                                     
             3ms sys-fs-fuse-connections.mount                                            
             2ms sys-kernel-config.mount                                                  
             1ms snapd.socket
          Code:
          Startup finished in 3.659s (kernel) + 49.262s (userspace) = 52.922s 
          graphical.target reached after 49.231s in userspace

          Comment


            #6
            In my personal experience, @kaiben, computers reach a point where they're just no longer able to handle the latest version of Kubuntu. That's why one of my desktops is still running 9.10.

            I had upgraded its components as much as they could be upgraded, but that still wasn't enough to handle anything later than 9.10. If you're the DIY type and can upgrade your hardware, you might want to consider that, if that's the problem of course.

            One thing I've done in the past is switch to a lightweight Linux distro for a computer that was just hopelessly outdated, couldn't handle Kubuntu, but still worked. I'm not up on lightweight distros now, but if you're interested in trying that, it should be very easy to find info on those.
            Xenix/UNIX user since 1985 | Linux user since 1991 | Was registered Linux user #163544

            Comment


              #7
              First, I ALWAYS advise against updating from one LTS to the next. I ALWAYS do a fresh install and then restore my data and settings. It is a lot smoother and easier in the long run. Avoids a LOT of troubles.

              I am running a 9 year old Acer V3-771G that has two SSD's, a 750GB rust spinner mounted only for archives, 16GB RAM and an NVidia GT650M. My desktop is reached in 5.3 seconds. but it takes about 20 seconds for POST to run. Your readings say that you reach your desktop in 49 seconds after the post, which is about what I had (60 to 90 sec depending on what I had running as services) when I booted from rust. Activating Nvidia, AND, switching to SSD's made a world of difference.

              However, 4 minutes of POST suggests that your HD is floundering. You might want to install smartmontools and check your HD failing services.
              "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
              – John F. Kennedy, February 26, 1962.

              Comment


                #8
                I suggest:
                • editing /etc/default/grub to remove the words "quiet splash" from the line that has them, and running sudo update-grub ; when booting you'll see more of what's happening, and that might reveal something
                • if the computer doesn't use an SSD, investigate getting a smallish SATA one; they're quite cheap now
                Regards, John Little

                Comment


                  #9
                  but I still need more than 4 minutes until the desktop is available.
                  Code:
                  startup finished in 3.659s (kernel) + 49.262s (userspace) = [B][COLOR=#ff0000]52.922s [/COLOR][/B]
                  graphical.target reached after 49.231s in userspace

                  Hmmm....

                  Assuming it is taking 4 minutes from the time you log in to get to a desktop? or is it total time?
                  What is missing is the initial part of the systemd-analyze output showing the firmware (Bios POST) and boot loader (grub) times, but the total time to the 'graphical target' is less than one minute (and includes the firmware and loader times iirc), so something is happening after Plasma/xorg/etc have reported being loaded.





                  Don't listen to the upgrade nay-sayers
                  you obviously have had a good run

                  Comment


                    #10
                    First of all, thank you all for the responses.

                    Currently it is much faster.
                    Time from login until the desktop is available is around 50s. This is the time the system-analyze critical_chain command has reported and is good enough.

                    So it seems that the tasks making it slow are not running on every login, but e.g. once a day/week. I often use the Linux PC only once a week, so it may looked for me as always.
                    What tasks are running so periodically? I googled a bit but found not much.

                    Comment


                      #11
                      It seems that the snapd demons search for potentially updated snaps is the main reason for the long time for login on my PC.

                      I switched snapd off (https://askubuntu.com/questions/1045...-auto-updating) and now I have to wait around 40s (also after being logged out for two days).

                      This is OK for me. For now I have no snaps installed and if I will need snaps in the future I must switch it on manually when needed.

                      Comment

                      Working...
                      X