gaenserich / hostsblock

an ad- and malware-blocking script for Linux
https://github.com/gaenserich/hostsblock
225 stars 28 forks source link

Hostsblock takes upto 1mins in boottime #103

Closed ConnahGriffin closed 4 years ago

ConnahGriffin commented 4 years ago

I though my boot-up time was way too long so I checked using systemd-analyze I am a relatively new user, do tell me what I should provide, I shall try my best to provide it.

Here is systemd-analyze time output:

nietzsche@AI-MK1:~$ systemd-analyze time
Startup finished in 13.394s (firmware) + 3.867s (loader) + 4.228s (kernel) + 1min 30.163s (userspace) = 1min 51.653s
graphical.target reached after 1min 30.100s in userspace

`

Here is systemd-analyze blame output:

nietzsche@AI-MK1:~$ systemd-analyze blame
    1min 17.959s hostsblock.service
     1min 1.103s apport-autoreport.service
       43.644s systemd-journal-flush.service
         39.119s vboxdrv.service
         21.060s dev-sda2.device
         16.569s snapd.service
         15.572s NetworkManager-wait-online.service
         14.242s dev-loop12.device
         13.449s dev-loop18.device
         13.430s dev-loop34.device
         12.975s dev-loop29.device
         12.880s dev-loop15.device
         12.497s dev-loop17.device
         12.497s dev-loop4.device
         12.088s dev-loop31.device
         11.955s dev-loop32.device
         11.620s dev-loop22.device
         11.476s dev-loop27.device
         11.362s dev-loop24.device
         11.351s dev-loop33.device
         11.223s dev-loop20.device
         11.187s dev-loop28.device
         11.042s dev-loop30.device
         10.738s dev-loop9.device
         10.701s dev-loop8.device
         10.439s dev-loop25.device
         10.427s dev-loop26.device
         10.079s dev-loop14.device
          9.778s dev-loop5.device
          9.618s dev-loop19.device
          9.387s dev-loop23.device
          9.385s dev-loop13.device
          9.064s dev-loop21.device
          9.062s dev-loop16.device
          9.012s motd-news.service
          8.597s dev-loop6.device
          8.574s libvirtd.service
          8.506s dev-loop11.device
          8.364s dev-loop10.device
          8.003s dev-loop2.device
          7.664s dev-loop7.device
          7.083s nmbd.service
          6.548s dev-loop0.device
          6.493s dev-loop3.device
          6.371s dev-loop1.device
          6.188s NetworkManager.service
          6.098s tor@default.service
          6.070s apt-daily.service
          6.048s udisks2.service
          4.814s networkd-dispatcher.service
          4.382s timidity.service
          4.214s systemd-udevd.service
          3.875s apparmor.service
          3.405s apache2.service
          2.642s accounts-daemon.service
          2.455s systemd-tmpfiles-setup-dev.service
          2.425s winbind.service
          2.322s lvm2-monitor.service
          2.279s smbd.service
          2.261s dnsmasq.service
          2.198s snap-core18-1885.mount
          2.159s snap-gnome\x2dcalculator-748.mount
          2.158s snap-gnome\x2d3\x2d34\x2d1804-33.mount
          2.157s snap-transmission\x2ddaemon\x2dsimosx-6.mount
          2.155s snap-gnome\x2dcharacters-539.mount
          2.154s snap-gnome\x2dcalculator-730.mount
          2.154s snap-gtk\x2dcommon\x2dthemes-1502.mount
          2.153s snap-simplescreenrecorder-1.mount
          2.135s snap-discord-112.mount
          2.134s snap-discord-109.mount
          1.924s dhcpcd.service
          1.865s avahi-daemon.service
          1.825s snap-gnome\x2d3\x2d28\x2d1804-116.mount
          1.816s plymouth-quit-wait.service
          1.811s lightdm.service
          1.785s snap-canonical\x2dlivepatch-94.mount
          1.783s snap-go-6123.mount
          1.778s snap-gnome\x2d3\x2d34\x2d1804-36.mount
          1.767s snap-core18-1880.mount
          1.754s snap-gnome\x2d3\x2d26\x2d1604-100.mount
          1.744s snap-gnome\x2dlogs-93.mount
          1.739s snap-canonical\x2dlivepatch-95.mount
          1.738s snap-go-6090.mount
          1.736s snap-sublime\x2dtext-85.mount
          1.735s snap-gnome\x2dsystem\x2dmonitor-148.mount
          1.575s ModemManager.service
          1.509s speech-dispatcher.service
          1.317s systemd-modules-load.service
          1.207s networking.service
          1.175s gpu-manager.service
          1.173s thermald.service
          1.173s tor.service
          1.169s bluetooth.service
           955ms ebtables.service
           946ms plymouth-start.service
           938ms keyboard-setup.service
           928ms systemd-tmpfiles-setup.service
           917ms snap-nuko-2.mount
           854ms swapfile.swap
           820ms snap-gnome\x2d3\x2d26\x2d1604-98.mount
           818ms snap-nuko-1.mount
           809ms wpa_supplicant.service
           781ms snap-gnome\x2d3\x2d28\x2d1804-128.mount
           778ms binfmt-support.service
           743ms systemd-tmpfiles-clean.service
           699ms systemd-journald.service
           693ms systemd-backlight@backlight:intel_backlight.service
           686ms systemd-fsck@dev-disk-by\x2duuid-50F5\x2d9C15.service
           659ms snap-spotify-41.mount
           659ms grub-common.service
           658ms snap-gtk\x2dcommon\x2dthemes-1506.mount
           596ms systemd-sysctl.service
           569ms snap-gitkraken-159.mount
           526ms polkit.service
           525ms rsyslog.service
           480ms ufw.service
           454ms snap-gitkraken-160.mount
           444ms systemd-random-seed.service
           439ms snap-gnome\x2dcharacters-550.mount
           423ms virtualbox.service
           385ms lm-sensors.service
           358ms qemu-kvm.service
           357ms apport.service
           335ms snap-core-9804.mount
           304ms snapd.socket
           285ms boot-efi.mount
           279ms dns-clean.service
           264ms snap-gnome\x2dsystem\x2dmonitor-145.mount
           256ms snap-gnome\x2dlogs-100.mount
           247ms snap-sublime\x2dtext-77.mount
           246ms snap-core-9788.mount
           228ms systemd-logind.service
           223ms plymouth-read-write.service
           205ms packagekit.service
           195ms upower.service
           160ms dev-mqueue.mount
           158ms sys-kernel-debug.mount
           157ms hostsblock-dnsmasq-restart.service
           157ms dev-hugepages.mount
           143ms snapd.apparmor.service
           143ms kmod-static-nodes.service
           143ms blk-availability.service
           136ms systemd-remount-fs.service
           125ms snapd.seeded.service
           111ms setvtrgb.service
            99ms libvirt-guests.service
            79ms systemd-update-utmp.service
            71ms user@1000.service
            65ms systemd-udev-trigger.service
            65ms fstrim.service
            63ms tlp.service
            59ms console-setup.service
            56ms systemd-timesyncd.service
            33ms proc-sys-fs-binfmt_misc.mount
            26ms hddtemp.service
            21ms systemd-user-sessions.service
            20ms pppd-dns.service
            20ms alsa-restore.service
            15ms kerneloops.service
             8ms ureadahead-stop.service
             5ms vboxballoonctrl-service.service
             4ms systemd-update-utmp-runlevel.service
             4ms vboxweb-service.service
             4ms rtkit-daemon.service
             3ms vboxautostart-service.service
             2ms sys-kernel-config.mount
             2ms sys-fs-fuse-connections.mount

` I am currenty using Xubuntu 18.04, update right before submission of this post.

ConnahGriffin commented 4 years ago

My bad, it was because I had added unnecessary lines for the config which made a loop. It's fixed now