/lib/systemd 占用大量 CPU

/lib/systemd 占用大量 CPU

我最近查看了我的 CPU 使用率,发现lib/systemd/systemd-resolved即使在启动时,CPU 的使用率也高达 80-100%。我检查了系统日志,并试图确定问题所在,但我似乎无法准确定位问题所在,或者我只是不知道我在寻找什么。

以下是htop信息:

在此处输入图片描述

以下是syslog信息:

Aug  4 07:54:39 baal-Aspire-5733Z zeitgeist-fts[2590]: Unable to get info on application://nautilus-autostart.desktop
Aug  4 07:55:16 baal-Aspire-5733Z anacron[27993]: Job `cron.daily' terminated
Aug  4 07:56:15 baal-Aspire-5733Z /usr/lib/snapd/snapd[956]: snapmgr.go:496: DEBUG: Next refresh scheduled for 2017-08-04 12:01:22.315368117 -0500 CDT.
Aug  4 07:57:29 baal-Aspire-5733Z systemd-timesyncd[810]: Synchronized to time server [2001:67c:1560:8003::c8]:123 (ntp.ubuntu.com).
Aug  4 07:59:07 baal-Aspire-5733Z anacron[27993]: Job `cron.weekly' started
Aug  4 07:59:07 baal-Aspire-5733Z anacron[29231]: Updated timestamp for job `cron.weekly' to 2017-08-04
Aug  4 07:59:21 baal-Aspire-5733Z anacron[27993]: Job `cron.weekly' terminated
Aug  4 07:59:21 baal-Aspire-5733Z anacron[27993]: Normal exit (2 jobs run)
Aug  4 07:59:22 baal-Aspire-5733Z systemd[1707]: Starting Notification regarding a new release of Ubuntu...
Aug  4 07:59:45 baal-Aspire-5733Z check-new-release-gtk[29246]: /usr/lib/ubuntu-release-upgrader/check-new-release-gtk:30: PyGIWarning: Gtk was imported without specifying a version first. Use gi.require_version('Gtk', '3.0') before import to ensure that the right version gets loaded.
Aug  4 07:59:45 baal-Aspire-5733Z check-new-release-gtk[29246]:   from gi.repository import Gtk
Aug  4 07:59:45 baal-Aspire-5733Z check-new-release-gtk[29246]: WARNING:root:timeout reached, exiting
Aug  4 07:59:45 baal-Aspire-5733Z systemd[1707]: Started Notification regarding a new release of Ubuntu.
Aug  4 08:00:53 baal-Aspire-5733Z AptDaemon: INFO: Quitting due to inactivity
Aug  4 08:00:53 baal-Aspire-5733Z org.debian.apt[953]: 08:00:53 AptDaemon [INFO]: Quitting due to inactivity
Aug  4 08:00:53 baal-Aspire-5733Z org.debian.apt[953]: 08:00:53 AptDaemon [INFO]: Quitting was requested
Aug  4 08:00:53 baal-Aspire-5733Z AptDaemon: INFO: Quitting was requested
Aug  4 08:02:50 baal-Aspire-5733Z dnsmasq[1157]: Maximum number of concurrent DNS queries reached (max: 150)
Aug  4 08:02:56 baal-Aspire-5733Z dnsmasq[1157]: Maximum number of concurrent DNS queries reached (max: 150)
Aug  4 08:03:02 baal-Aspire-5733Z dnsmasq[1157]: Maximum number of concurrent DNS queries reached (max: 150)
Aug  4 08:04:38 baal-Aspire-5733Z dnsmasq[1157]: message repeated 16 times: [ Maximum number of concurrent DNS queries reached (max: 150)]
Aug  4 08:04:42 baal-Aspire-5733Z wpa_supplicant[1238]: wlp2s0: WPA: Group rekeying completed with b0:da:f9:ac:e0:e2 [GTK=TKIP]
Aug  4 08:04:44 baal-Aspire-5733Z dnsmasq[1157]: Maximum number of concurrent DNS queries reached (max: 150)

我担心的syslogmax DNS queries,我认为这不会导致任何 CPU 问题,但我以前错了。

strace对该过程运行了大约二十秒并得到了一些输出:

     0.000000 getrandom("|\24", 2, GRND_NONBLOCK) = 2
     0.000122 stat("/etc/resolv.conf", {st_mode=S_IFREG|0644, st_size=303, ...}) = 0
     0.000098 getrandom("\210\234", 2, GRND_NONBLOCK) = 2
     0.000052 clock_gettime(CLOCK_BOOTTIME, {758, 539479248}) = 0
     0.000056 open("/run/systemd/netif/links/4", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
     0.000061 stat("/etc/resolv.conf", {st_mode=S_IFREG|0644, st_size=303, ...}) = 0
     0.000045 stat("/etc/resolv.conf", {st_mode=S_IFREG|0644, st_size=303, ...}) = 0
     0.000035 socket(AF_INET, SOCK_DGRAM|SOCK_CLOEXEC|SOCK_NONBLOCK, IPPROTO_IP) = 20
     0.000032 connect(20, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("127.0.0.1")}, 16) = 0
     0.000039 epoll_ctl(4, EPOLL_CTL_ADD, 20, {EPOLLIN, {u32=2166115856, u64=94835044011536}}) = 0
     0.000035 write(20, "\210\234\1\0\0\1\0\0\0\0\0\1\taskubuntu\3com\0\0\34\0\1\0"..., 64) = 64
     0.000091 clock_gettime(CLOCK_BOOTTIME, {758, 539866856}) = 0
     0.000039 epoll_ctl(4, EPOLL_CTL_DEL, 20, NULL) = 0
     0.000027 close(20)                 = 0
     0.000042 sendmsg(12, {msg_name(16)={sa_family=AF_INET, sin_port=htons(57020), sin_addr=inet_addr("127.0.0.1")}, msg_iov(1)=[{"\31q\201\200\0\1\0\0\0\0\0\1\taskubuntu\3com\0\0\34\0\1\0"..., 42}], msg_controllen=28, [{cmsg_len=28, cmsg_level=SOL_IP, cmsg_type=IP_PKTINFO, {ipi_ifindex=if_nametoindex("lo"), ipi_spec_dst=inet_addr("127.0.0.53"), ipi_addr=inet_addr("127.0.0.53")}}], msg_flags=0}, 0) = 42
     0.000452 epoll_wait(4, [{EPOLLIN, {u32=2165783712, u64=94835043679392}}], 29, -1) = 1
     0.000035 clock_gettime(CLOCK_BOOTTIME, {758, 540460822}) = 0
     0.000029 recvfrom(12, NULL, 0, MSG_PEEK|MSG_TRUNC, NULL, NULL) = 64
     0.000030 recvmsg(12, {msg_name(16)={sa_family=AF_INET, sin_port=htons(7890),
...

但这里一切似乎都很正常。有人知道是什么原因导致这种情况发生的吗?

相关内容