[Seek Help] 开机有些程序占用的时间太多了,可以优化一下吗?不想等太久
Tofloor
poster avatar
把一切操作变成GUI
deepin
Backbone of ecological co-construction group
2024-01-10 05:08
Author

V23开机有些程序占用的时间太多了,可以优化一下吗?不想等太久

感觉开机时间等太久了

用命令行查看了一下

systemd-analyze blame
30.549s plymouth-quit-wait.service
14.515s systemd-journal-flush.service
11.214s dev-sda5.device
10.774s udisks2.service
10.531s NetworkManager-wait-online.service
10.060s spark-update-notifier.service
 8.894s deepin-accounts1-daemon.service
 8.869s accounts-daemon.service
 8.349s lightdm.service
 8.281s nmbd.service
 7.008s deepin-login-sound.service
 6.934s polkit.service
 6.591s NetworkManager.service
 6.564s wpa_supplicant.service
 6.549s avahi-daemon.service
 6.547s bluetooth.service
 6.537s org.deepin.linglong.PackageManager.service
 6.535s org.deepin.linglong.SystemHelper.service
 5.770s e2scrub_reap.service
 5.582s smartmontools.service
 5.356s cups.service
 4.855s ModemManager.service
 2.881s networking.service
 2.814s zram-swap.service
 2.423s upower.service
 2.158s systemd-rfkill.service
 1.957s smbd.service
 1.769s deepin-authenticate.service
 1.394s lm-sensors.service
 1.208s systemd-backlight@backlight:intel_backlight.service
 1.164s systemd-udevd.service
 1.132s systemd-modules-load.service
 1.128s systemd-logind.service
 1.122s winbind.service
 1.027s laptop-mode.service
  796ms systemd-random-seed.service
  784ms systemd-fsck@dev-disk-by\x2duuid-54CC\x2d09D7.service
  775ms systemd-backlight@leds:platform::kbd_backlight.service
  761ms systemd-udev-trigger.service
  724ms apt-daily-upgrade.service
  723ms systemd-tmpfiles-setup-dev.service
  693ms boot-efi.mount
  684ms [email protected]
  446ms systemd-journald.service
  436ms plymouth-read-write.service
  385ms dde-filemanager-daemon.service
  374ms systemd-sysusers.service
  351ms systemd-tmpfiles-setup.service
  347ms lvm2-monitor.service
  339ms plymouth-start.service
  333ms systemd-remount-fs.service
  315ms fstrim.service
  275ms ifupdown-pre.service
  247ms systemd-sysctl.service
  208ms systemd-binfmt.service
  206ms packagekit.service
  142ms fprintd.service
   96ms systemd-timesyncd.service
   91ms ipwatchd.service
   83ms dde-dconfig-daemon.service
   68ms systemd-update-utmp.service
   58ms dev-hugepages.mount
   56ms dev-mqueue.mount
   54ms sys-kernel-debug.mount
   52ms sys-kernel-tracing.mount
   51ms rtkit-daemon.service
   50ms kmod-static-nodes.service
   47ms systemd-tmpfiles-clean.service
   45ms [email protected]
   45ms systemd-user-sessions.service
   45ms [email protected]
   45ms [email protected]
   38ms proc-sys-fs-binfmt_misc.mount
   25ms [email protected]
   23ms alsa-restore.service
   19ms systemd-update-utmp-runlevel.service
    5ms sys-fs-fuse-connections.mount
    4ms sys-kernel-config.mount
    3ms lmt-poll.service
    2ms modprobe@efi_pstore.service
    2ms modprobe@dm_mod.service
    2ms [email protected]
    1ms binfmt-support.service
   60us blk-availability.service

那些秒数太小的先不看,着重看看占用时间大的,

30.549s plymouth-quit-wait.service

一个开机关机动画真的没太大必要吧?仅仅只是为了观感而牺牲启动的时间的话,大可不必了。

10.060s spark-update-notifier.service

不知道为什么安装完之后会开机启动有这个服务,开机的时候没必要通知我更新软件吧。。。。到时候需要再打开星火看看也可以的。希望默认不要自启这个服务。

7.008s deepin-login-sound.service

这个登陆声音也要占用7秒。。。。占用这么多时间,这个登陆声音,听与不听真的不影响~

6.547s bluetooth.service

至于这个蓝牙。。。其实开机那会根本没人会去用蓝牙吧?出现登陆界面之后再开启也不是不行?蓝牙鼠标蓝牙耳机等设备也是在登陆界面才用得上,对吗?

这里加起来占用了大概53s,我总时间是1min13s。

kk111k-mi111111111111n.png


我们再来看一下14.515s systemd-journal-flush.service

systemd-journal-flush.service 是 Linux 系统中的一个服务,它的主要作用是将存储在 /run/log/journal 中的日志数据刷新(即写入)到 /var/log/journal。

打开看一下,占4.7GB
image.png

如果你的系统中已经有大量的日志文件,这个服务可能会导致系统启动速度变慢。这是因为在启动过程中,系统需要检查大量的旧日志文件,并将新的日志数据附加到这些文件中

sudo journalctl --disk-usage
Archived and active journals take up 3.3G in the file system.

归档和活动日志在文件系统中占用3.3G。

“虽然你可以禁用这个服务,但这并不推荐。因为如果禁用了这个服务,可能会导致不是所有的日志数据都能写入到磁盘中,这在调试启动故障时可能会造成困扰。此外,Journald 是 systemd linux 中的一项基本服务,许多其他服务都依赖于它。”

我尝试把他设置为只保留不超过1g,少于3天,文件数少于5个。

sudo journalctl --vacuum-size=1G --vacuum-time=3days --vacuum-files=5

Startup finished in 5.546s (firmware) + 4.351s (loader) + 7.353s (kernel) + 57.093s (userspace) = 1min 14.345s  graphical.target reached after 57.053s in userspace.

其实用户空间占用的是大头,我再看看用户空间这里的大头(+号后面是所花时间,@是第n秒时)

sudo systemd-analyze critical-chain
graphical.target @57.053s
└─multi-user.target @57.053s
  └─smbd.service @54.927s +2.125s
    └─winbind.service @53.539s +1.361s
      └─nmbd.service @46.919s +6.599s
        └─network-online.target @46.900s
          └─NetworkManager-wait-online.service @33.726s +13.173s
            └─NetworkManager.service @27.072s +6.623s
              └─dbus.service @27.069s
                └─basic.target @26.728s
                  └─sockets.target @26.728s
                    └─dbus.socket @26.728s
                      └─sysinit.target @26.574s
                        └─systemd-update-utmp.service @26.432s +142ms
                          └─systemd-tmpfiles-setup.service @25.663s +735ms
                            └─systemd-journal-flush.service @3.687s +21.931s
                              └─systemd-remount-fs.service @3.381s +256ms
                                └─systemd-journald.socket @3.306s
                                  └─system.slice @3.251s
                                    └─-.slice @3.251s

可以看出主要还是这俩:

systemd-journal-flush.service @3.687s +21.931s

NetworkManager-wait-online.service @33.726s +13.173s

尝试禁掉 NetworkManager-wait-online.service试试先。

sudo systemctl disable NetworkManager-wait-online.service
Removed "/etc/systemd/system/network-online.target.wants/NetworkManager-wait-online.service".

systemd-analyze time
Startup finished in 6.649s (firmware) + 6.078s (loader) + 6.842s (kernel) + 42.904s (userspace) = 1min 2.474s 
graphical.target reached after 42.853s in userspace.
systemd-analyze blame
13.184s udisks2.service
12.496s nmbd.service
11.144s accounts-daemon.service
10.454s dev-sda5.device
10.428s lightdm.service
8.795s polkit.service
8.577s avahi-daemon.service
7.823s bluetooth.service
7.764s wpa_supplicant.service
7.746s NetworkManager.service
7.697s org.deepin.linglong.PackageManager.service
7.695s org.deepin.linglong.SystemHelper.service
7.558s systemd-tmpfiles-setup.service
7.486s deepin-accounts1-daemon.service
7.372s e2scrub_reap.service
6.749s ModemManager.service
6.606s smartmontools.service
6.541s upower.service
6.314s cups.service
4.500s networking.service
4.443s winbind.service
3.737s zram-swap.service
2.992s binfmt-support.service
2.205s deepin-authenticate.service
2.045s smbd.service
1.594s laptop-mode.service
1.429s systemd-logind.service
1.039s lm-sensors.service
885ms plymouth-read-write.service
823ms systemd-modules-load.service
778ms [email protected]
674ms systemd-udev-trigger.service
624ms packagekit.service
617ms dde-dconfig-daemon.service
590ms systemd-udevd.service
556ms systemd-random-seed.service
551ms systemd-backlight@backlight:intel_backlight.service
549ms systemd-journald.service
479ms systemd-tmpfiles-setup-dev.service
470ms plymouth-start.service
375ms systemd-backlight@leds:platform::kbd_backlight.service
359ms systemd-update-utmp.service
358ms lvm2-monitor.service
345ms systemd-timesyncd.service
325ms systemd-fsck@dev-disk-by\x2duuid-54CC\x2d09D7.service
313ms dde-filemanager-daemon.service
301ms systemd-rfkill.service
274ms systemd-sysusers.service
241ms systemd-remount-fs.service
182ms systemd-binfmt.service
171ms systemd-sysctl.service
149ms fprintd.service
133ms dev-hugepages.mount
131ms dev-mqueue.mount
129ms sys-kernel-debug.mount
127ms sys-kernel-tracing.mount
124ms kmod-static-nodes.service
120ms [email protected]
116ms [email protected]
115ms [email protected]
107ms ipwatchd.service
93ms rtkit-daemon.service
76ms boot-efi.mount
67ms ifupdown-pre.service
34ms proc-sys-fs-binfmt_misc.mount
27ms [email protected]
23ms systemd-user-sessions.service
19ms systemd-update-utmp-runlevel.service
7ms alsa-restore.service
3ms lmt-poll.service
2ms sys-fs-fuse-connections.mount
2ms modprobe@efi_pstore.service
2ms [email protected]
2ms modprobe@dm_mod.service
1ms sys-kernel-config.mount
58us blk-availability.service

顺带systemd-analyze 中文手册

Reply Favorite View the author
All Replies
1 / 2
To page
叶羽
deepin
2024-01-10 05:51
#1

就和英伟达那个调整一样,有一部分人是想要美和较弱性能的,有一部分是极致性能的,有一部分是极致美性能差的,我一直觉得如果官方不把系统里的那个特效选项包括的东西再多一些,即使关掉也省不了多少性能的。真的希望效果和win7里的个性化功能一样,要极致性能就调成那个黑白的界面,关掉所有平滑移动什么的,要美有透明,要平衡有经典模式,这样才好。

如果官方不做,不如社区里单独整一个追求性能极致的版本要什么动画去掉

Reply View the author
deepin
2024-01-10 07:51
#2

这样的开机时间正常吗?
image.png

Reply View the author
jjcui8595
deepin
2024-01-10 08:04
#3

把前两个disable试试joy

Reply View the author
dgmenghuan
deepin
2024-01-10 08:30
#4

tail

Reply View the author
把一切操作变成GUI
deepin
Backbone of ecological co-construction group
2024-01-10 09:30
#5
jjcui8595

把前两个disable试试joy

开机一样有动画诶?

Reply View the author
jjcui8595
deepin
2024-01-10 09:32
#6
把一切操作变成GUI

开机一样有动画诶?

开机速度快了吗?

Reply View the author
把一切操作变成GUI
deepin
Backbone of ecological co-construction group
2024-01-10 09:34
#7
jjcui8595

开机速度快了吗?

我是用musk掉的,但是时间没有变少

Reply View the author
neko
deepin
Ecological co-builder
2024-01-10 11:02
#8

spark-update-notifier是你安装的星火应用商店吧,星火商店里把更新检查关闭

Reply View the author
neko
deepin
Ecological co-builder
2024-01-10 11:03
#9

这是我23的XD
image.png

Reply View the author
废物头子
deepin
2024-01-10 11:26
#10

我好奇这块硬盘的时间

image.png

Reply View the author
deepin
2024-01-10 12:06
#11

这样的开机时间正常吗?
image.png

lcy@lcy-PC:~$ systemd-analyze blame
3.303s NetworkManager-wait-online.service
1.697s plymouth-quit-wait.service
525ms systemd-tmpfiles-setup.service
436ms dev-sda1.device
424ms deepin-accounts1-daemon.service
378ms systemd-binfmt.service
370ms [email protected]
363ms proc-sys-fs-binfmt_misc.mount
290ms systemd-journal-flush.service
267ms ModemManager.service
261ms smbd.service
223ms nmbd.service
217ms deepin-authenticate.service
214ms systemd-udev-trigger.service
197ms upower.service
163ms accounts-daemon.service
161ms deepin-login-sound.service
150ms fprintd.service
149ms lightdm.service
146ms udisks2.service
134ms org.deepin.linglong.PackageManager.service
130ms polkit.service
130ms ipwatchd.service
119ms smartmontools.service
118ms winbind.service
115ms systemd-logind.service
106ms systemd-udevd.service
105ms systemd-journald.service
103ms bluetooth.service
102ms avahi-daemon.service
98ms lvm2-monitor.service
97ms systemd-fsck@dev-disk-by\x2duuid-ced23ab1\x2d80c4\x2d4e74\x2d939e\x2d4bdf5cbaeca1.service
95ms NetworkManager.service
90ms systemd-fsck@dev-disk-by\x2duuid-5298\x2d4C7D.service
88ms e2scrub_reap.service
80ms cups.service
78ms dde-filemanager-daemon.service
78ms org.deepin.linglong.SystemHelper.service
74ms systemd-timesyncd.service
66ms laptop-mode.service
62ms systemd-modules-load.service
62ms wpa_supplicant.service
62ms systemd-rfkill.service
60ms networking.service
53ms systemd-tmpfiles-setup-dev.service
49ms [email protected]
48ms [email protected]
45ms lm-sensors.service
43ms alsa-restore.service
43ms systemd-sysusers.service
41ms systemd-random-seed.service
34ms plymouth-start.service
28ms dde-dconfig-daemon.service
25ms dev-hugepages.mount
24ms dev-mqueue.mount
23ms sys-kernel-debug.mount
23ms sys-kernel-tracing.mount
21ms kmod-static-nodes.service
19ms [email protected]
16ms systemd-update-utmp.service
16ms plymouth-read-write.service
15ms [email protected]
13ms systemd-user-sessions.service
13ms systemd-update-utmp-runlevel.service
12ms systemd-remount-fs.service
12ms rtkit-daemon.service
11ms boot.mount
9ms systemd-sysctl.service
7ms boot-efi.mount
6ms modprobe@dm_mod.service
5ms modprobe@efi_pstore.service
5ms sys-fs-fuse-connections.mount
4ms lmt-poll.service
4ms ifupdown-pre.service
4ms [email protected]
4ms sys-kernel-config.mount
33us blk-availability.service
lines 36-77/77 (END)

Reply View the author
昨夜的星辰
deepin
2024-01-10 12:17
#12

楼主这个很明显有问题,一个可能跟你的硬件有关

我这显示如下,看来星火这个更新我得给他关掉,有点费时间

683ms plymouth-quit-wait.service 楼主这个时间长应该是在等待其它的服务启动

10.070s spark-update-notifier.service
4.751s NetworkManager-wait-online.service
870ms vboxdrv.service
683ms plymouth-quit-wait.service
384ms apt-daily-upgrade.service
328ms man-db.service
309ms [email protected]
240ms dev-nvme0n1p6.device
162ms logrotate.service
154ms upower.service
132ms systemd-udev-trigger.service
109ms deepin-login-sound.service
105ms smbd.service
101ms ipwatchd.service
100ms systemd-journal-flush.service

等待网络在线这个也费时间
image.png

Reply View the author
昨夜的星辰
deepin
2024-01-10 12:20
#13

系统监视器可以试试手动禁用掉相关服务的自动启动

image.png

Reply View the author
昨夜的星辰
deepin
2024-01-10 12:26
#14

禁用掉两个耗时大的服务后开机速度是真的快😁

Reply View the author
昨夜的星辰
deepin
2024-01-10 12:32
#15

友情提醒一下,千万不要随意把服务的自启动改成手动,改之前要明白改的是啥,涉及系统服务的慎改

我改了两个,一个是等待网络在线的,一个是星火的检查软件更新

Reply View the author
Tonny
deepin
2024-01-10 12:39
#16
It has been deleted!
Tonny
deepin
2024-01-10 12:42
#17
It has been deleted!
把一切操作变成GUI
deepin
Backbone of ecological co-construction group
2024-01-10 18:59
#18
废物头子

我好奇这块硬盘的时间

image.png

机械硬盘,这个时间正常吗?

Reply View the author
把一切操作变成GUI
deepin
Backbone of ecological co-construction group
2024-01-10 19:19
#19
昨夜的星辰

楼主这个很明显有问题,一个可能跟你的硬件有关

我这显示如下,看来星火这个更新我得给他关掉,有点费时间

683ms plymouth-quit-wait.service 楼主这个时间长应该是在等待其它的服务启动

10.070s spark-update-notifier.service
4.751s NetworkManager-wait-online.service
870ms vboxdrv.service
683ms plymouth-quit-wait.service
384ms apt-daily-upgrade.service
328ms man-db.service
309ms [email protected]
240ms dev-nvme0n1p6.device
162ms logrotate.service
154ms upower.service
132ms systemd-udev-trigger.service
109ms deepin-login-sound.service
105ms smbd.service
101ms ipwatchd.service
100ms systemd-journal-flush.service

等待网络在线这个也费时间
image.png

等待网络在线这个禁掉的话不会有影响吗?

Reply View the author
昨夜的星辰
deepin
2024-01-10 20:13
#20
把一切操作变成GUI

等待网络在线这个禁掉的话不会有影响吗?

我已经禁了,并没有什么问题,服务器可能不行,桌面端又没有必须在开机前连网搞定的事情

Reply View the author
1 / 2
To page