您尚未登录。

#1 2025-03-16 18:17:36

chrisivanovic
会员
注册时间: 2023-06-13
帖子: 80

[已解决]空载cpu占用率异常

[已解决]
运行

systemd-cgtop

发现是rustdesk抽风了, 停止进程解决
---
笔记本, wm是hyprland, 今天突然风扇格外的响, btop/htop能看到各个核心都有15%-30%左右负载, 但以cpu占用率排序没看到任何一个进程有大量cpu占用, 最高的是hyprland自己, 在5%左右, 其他进程有一个firefox, 六七个标签, 一个alacritty开着, 啥也没运行
去powertop看了一下:

Summary: 5597.6 wakeups/second,  0.0 GPU ops/seconds, 0.0 VFS ops/sec and 175.7% CPU use

                Usage       Events/s    Category       Description
             39.4 ms/s     3235.9       Timer          tick_nohz_handler
             59.4 ms/s     765.6        Process        [PID 388619] Hyprland
             11.0 ms/s     206.7        Interrupt      [7] sched(softirq)
              7.1 ms/s     131.0        Process        [PID 1235944] /usr/lib/firefox/firefox
              1.3 ms/s     128.1        kWork          delayed_vfree_work
              1.7 ms/s     115.5        Process        [PID 18] [rcu_preempt]
              4.3 ms/s      73.7        Process        [PID 1827] /usr/bin/1panel
            621.2 µs/s      65.0        Timer          inactive_task_timer
             21.0 ms/s      47.5        Process        [PID 1235903] /usr/lib/firefox/firefox
              1.0 ms/s      35.9        Process        [PID 1821] /usr/bin/1panel
            593.2 µs/s      32.0        Process        [PID 1079902] /usr/share/rustdesk/rustd
            566.8 µs/s      29.1        Process        [PID 1079901] /usr/share/rustdesk/rustd
             11.7 ms/s      23.3        Interrupt      [9] RCU(softirq)
            671.7 µs/s      27.2        Process        [PID 1079909] /usr/share/rustdesk/rustd
              0.7 ms/s      25.2        Process        [PID 1079910] /usr/share/rustdesk/rustd
              6.5 ms/s      22.3        Process        [PID 1] /sbin/init
            545.3 µs/s      23.3        Process        [PID 1079903] /usr/share/rustdesk/rustd
            536.7 µs/s      23.3        Process        [PID 1079900] /usr/share/rustdesk/rustd
              1.0 ms/s      22.3        Process        [PID 1848] /usr/bin/1panel
              0.7 ms/s      21.3        Interrupt      [57] amdgpu
              7.9 ms/s      10.7        Timer          timerfd_tmrproc
            111.4 µs/s      13.6        kWork          psi_avgs_work
            349.5 µs/s      12.6        Process        [PID 790] /usr/bin/containerd
            247.7 µs/s      10.7        Process        [PID 1116167] /usr/bin/dockerd -H fd://
             26.3 ms/s      0.00        Process        [PID 1265403] ps
             23.7 ms/s       1.0        Process        [PID 1265425] ps
             26.2 ms/s      0.00        Process        [PID 1265392] ps
              3.8 ms/s       8.7        Process        [PID 1265086] systemd-userwork: waiting
             21.5 ms/s       1.0        Process        [PID 1265381] ps
              1.2 ms/s       8.7        Process        [PID 389549] /usr/bin/python /usr/bin/b
             23.3 ms/s      0.00        Process        [PID 1265414] ps
             23.1 ms/s      0.00        Process        [PID 1265235] ps
             22.9 ms/s      0.00        Process        [PID 1265246] ps
             22.5 ms/s      0.00        Process        [PID 1265447] ps
             22.4 ms/s      0.00        Process        [PID 1265268] ps
            224.5 µs/s       8.7        kWork          drm_sched_run_job_work
             36.9 µs/s       8.7        kWork          drm_sched_free_job_work
             23.8 µs/s       8.7        kWork          toggle_allocation_gate
              2.1 ms/s       7.8        Process        [PID 1263499] alacritty
             21.6 ms/s      0.00        Process        [PID 1265301] ps
             21.6 ms/s      0.00        Process        [PID 1265312] ps
             18.6 ms/s       1.0        Process        [PID 1265142] powertop

"5597.6 wakeups/second", 这应该就是原因吧? 要怎么查是哪个进程有问题呢?
hyprland的配置文件:

################
### MONITORS ###
################

# See https://wiki.hyprland.org/Configuring/Monitors/
monitor=eDP-1,2560x1600@60,auto,1.6

# XWayland
#xwayland {
#  force_zero_scaling = true
#}
###################
### MY PROGRAMS ###
###################

# See https://wiki.hyprland.org/Configuring/Keywords/

# Set programs that you use
$terminal = alacritty
$fileManager = dolphin
$menu = tofi-drun | xargs hyprctl dispatch exec --


#################
### AUTOSTART ###
#################

# Autostart necessary processes (like notifications daemons, status bars, etc.)
# Or execute your favorite apps at launch like this:
# exec = gsettings set org.gnome.desktop.interface gtk-theme "Adapta-Dark"
# for GTK3 apps
# exec = gsettings set org.gnome.desktop.interface color-scheme "prefer-dark"
# for GTK4 apps

#exec-once = echo 'Xft.dpi:168' | xrdb -merge
exec-once = hyprpaper & waybar & nm-applet & hypridle & udiskie & bluman-tray
exec-once = firefox & fcitx5 --replace -d
exec-once = systemctl --user start plasma-polkit-agent
exec-once = clipse -listen
#############################
### ENVIRONMENT VARIABLES ###
#############################

# See https://wiki.hyprland.org/Configuring/Environment-variables/

# for pure wayland
#env = XCURSOR_SIZE,24
env = HYPRCURSOR_SIZE,24
env = QT_QPA_PLATFORMTHEME,qt6ct
env = QT_QPA_PLATFORM,wayland;xcb
env = XDG_MENU_PREFIX,arch-
env = QT_IM_MODULE=fcitx
env = XMODIFIERS=@im=fcitx
env = GTK_IM_MODULE=fcitx 
env = SDL_IM_MODULE=fcitx
# for xwayland
#env = GDK_SCALE,2
#env = QT_SCREEN_SCALE_FACTORS=1
#env = QT_SCALE_FACTOR=1.75
#env = QT_AUTO_SCREEN_SCALE_FACTOR=1.5
env = XCURSOR_SIZE,32
# env = GTK_THEME, Adapta-Dark
#####################
### LOOK AND FEEL ###
#####################

# Refer to https://wiki.hyprland.org/Configuring/Variables/

# https://wiki.hyprland.org/Configuring/Variables/#general
general {
    gaps_in = 4
    gaps_out = 8

    border_size = 4

    # https://wiki.hyprland.org/Configuring/Variables/#variable-types for info about colors
    col.active_border = rgba(33ccffee) rgba(00ff99ee) 45deg
    col.inactive_border = rgba(595959aa)

    # Set to true enable resizing windows by clicking and dragging on borders and gaps
    resize_on_border = false

    # Please see https://wiki.hyprland.org/Configuring/Tearing/ before you turn this on
    allow_tearing = false

    layout = dwindle
    # 拖动右下角调整窗口大小
    # resize_corner = 3
}

# https://wiki.hyprland.org/Configuring/Variables/#decoration
decoration {
    rounding = 10
    rounding_power = 2

    # Change transparency of focused and unfocused windows
    active_opacity = 1.0
    inactive_opacity = 0.9

    shadow {
        enabled = false
        range = 4
        render_power = 3
        color = rgba(1a1a1aee)
    }

    # https://wiki.hyprland.org/Configuring/Variables/#blur
    blur {
        enabled = false
        size = 3
        passes = 1
	new_optimizations = true
        vibrancy = 0.1696
    }
}

# https://wiki.hyprland.org/Configuring/Variables/#animations
animations {
    enabled = yes, please :)

    # Default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more

    bezier = easeOutQuint,0.23,1,0.32,1
    bezier = easeInOutCubic,0.65,0.05,0.36,1
    bezier = linear,0,0,1,1
    bezier = almostLinear,0.5,0.5,0.75,1.0
    bezier = quick,0.15,0,0.1,1
    animation = global, 1, 10, default
    animation = border, 1, 5.39, easeOutQuint
    animation = windows, 1, 4.79, easeOutQuint
    animation = windowsIn, 1, 4.1, easeOutQuint, popin 87%
    animation = windowsOut, 1, 1.49, linear, popin 87%
    animation = fadeIn, 1, 1.73, almostLinear
    animation = fadeOut, 1, 1.46, almostLinear
    animation = fade, 1, 3.03, quick
    animation = layers, 1, 3.81, easeOutQuint
    animation = layersIn, 1, 4, easeOutQuint, fade
    animation = layersOut, 1, 1.5, linear, fade
    animation = fadeLayersIn, 1, 1.79, almostLinear
    animation = fadeLayersOut, 1, 1.39, almostLinear
    animation = workspaces, 1, 1.94, almostLinear, fade
    animation = workspacesIn, 1, 5.5, easeOutQuint, slide
    animation = workspacesOut, 1, 5.5, easeOutQuint, slide
}

# Ref https://wiki.hyprland.org/Configuring/Workspace-Rules/
# "Smart gaps" / "No gaps when only"
# uncomment all if you wish to use that.
# workspace = w[tv1], gapsout:0, gapsin:0
# workspace = f[1], gapsout:0, gapsin:0
# windowrulev2 = bordersize 0, floating:0, onworkspace:w[tv1]
# windowrulev2 = rounding 0, floating:0, onworkspace:w[tv1]
# windowrulev2 = bordersize 0, floating:0, onworkspace:f[1]
# windowrulev2 = rounding 0, floating:0, onworkspace:f[1]

# See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more
dwindle {
    pseudotile = true # Master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below
    preserve_split = true # You probably want this
}

# See https://wiki.hyprland.org/Configuring/Master-Layout/ for more
master {
    new_status = master
}

# https://wiki.hyprland.org/Configuring/Variables/#misc
misc {
    force_default_wallpaper = 0 # Set to 0 or 1 to disable the anime mascot wallpapers
    disable_hyprland_logo = true # If true disables the random hyprland logo / anime girl background. :(
    vfr = true
}


#############
### INPUT ###
#############

# https://wiki.hyprland.org/Configuring/Variables/#input
input {
    kb_layout = us
    kb_variant =
    kb_model =
    kb_options =
    kb_rules =
    repeat_delay = 300
    follow_mouse = 0

    sensitivity = 0 # -1.0 - 1.0, 0 means no modification.

    touchpad {
        natural_scroll = false
    }
}

# https://wiki.hyprland.org/Configuring/Variables/#gestures
gestures {
    workspace_swipe = true
}

# Example per-device config
# See https://wiki.hyprland.org/Configuring/Keywords/#per-device-input-configs for more
device {
    name = epic-mouse-v1
    sensitivity = 0
    accel_profile = flat
}


###################
### KEYBINDINGS ###
###################

# See https://wiki.hyprland.org/Configuring/Keywords/
$mainMod = SUPER # Sets "Windows" key as main modifier

# Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more
bind = $mainMod, Q, exec, $terminal
bind = $mainMod, C, killactive,
bind = $mainMod, M, exit,
bind = $mainMod, E, exec, $fileManager
bind = $mainMod, F, togglefloating,
bind = $mainMod, R, exec, $menu
bind = $mainMod, P, pseudo, # dwindle
bind = $mainMod, J, togglesplit, # dwindle

# Move focus with mainMod + arrow keys
bind = $mainMod, left, movefocus, l
bind = $mainMod, right, movefocus, r
bind = $mainMod, up, movefocus, u
bind = $mainMod, down, movefocus, d

# Switch workspaces with mainMod + [0-9]
bind = $mainMod, 1, workspace, 1
bind = $mainMod, 2, workspace, 2
bind = $mainMod, 3, workspace, 3
bind = $mainMod, 4, workspace, 4
bind = $mainMod, 5, workspace, 5
bind = $mainMod, 6, workspace, 6
bind = $mainMod, 7, workspace, 7
bind = $mainMod, 8, workspace, 8
bind = $mainMod, 9, workspace, 9
bind = $mainMod, 0, workspace, 10

# Move active window to a workspace with mainMod + SHIFT + [0-9]
bind = $mainMod SHIFT, 1, movetoworkspace, 1
bind = $mainMod SHIFT, 2, movetoworkspace, 2
bind = $mainMod SHIFT, 3, movetoworkspace, 3
bind = $mainMod SHIFT, 4, movetoworkspace, 4
bind = $mainMod SHIFT, 5, movetoworkspace, 5
bind = $mainMod SHIFT, 6, movetoworkspace, 6
bind = $mainMod SHIFT, 7, movetoworkspace, 7
bind = $mainMod SHIFT, 8, movetoworkspace, 8
bind = $mainMod SHIFT, 9, movetoworkspace, 9
bind = $mainMod SHIFT, 0, movetoworkspace, 10

# Example special workspace (scratchpad)
bind = $mainMod, S, togglespecialworkspace, magic
bind = $mainMod SHIFT, S, movetoworkspace, special:magic

# Scroll through existing workspaces with mainMod + left & right
bind = $mainMod CTRL, right, workspace, +1
bind = $mainMod CTRL, left, workspace, -1

# Move/resize windows with mainMod + LMB/RMB and dragging
bindm = $mainMod, mouse:272, movewindow
bindm = $mainMod, mouse:273, resizewindow

# Hyprshot
bind = , PRINT, exec, hyprshot -m region --clipboard-only

#Hyperlock
bind = $mainMod, L, exec, hyprlock

#Clipse - clipboard
bind = SUPER, V, exec, alacritty --class clipse -e clipse

# Laptop multimedia keys for volume and LCD brightness
bindel = ,XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+
bindel = ,XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-
bindel = ,XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle
bindel = ,XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle
bindel = ,XF86MonBrightnessUp, exec, brightnessctl s 10%+
bindel = ,XF86MonBrightnessDown, exec, brightnessctl s 10%-

# Requires playerctl
bindl = , XF86AudioNext, exec, playerctl next
bindl = , XF86AudioPause, exec, playerctl play-pause
bindl = , XF86AudioPlay, exec, playerctl play-pause
bindl = , XF86AudioPrev, exec, playerctl previous

##############################
### WINDOWS AND WORKSPACES ###
##############################

# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more
# See https://wiki.hyprland.org/Configuring/Workspace-Rules/ for workspace rules

# Example windowrule v1
# windowrule = float, ^(kitty)$

# Example windowrule v2
# windowrulev2 = float,class:^(kitty)$,title:^(kitty)$

# Ignore maximize requests from apps. You'll probably like this.
windowrulev2 = suppressevent maximize, class:.*

# Fix some dragging issues with XWayland
windowrulev2 = nofocus,class:^$,title:^$,xwayland:1,floating:1,fullscreen:0,pinned:0
# Tencent
windowrulev2 = float,class:^(wechat)$,title:^(微信)$
windowrulev2 = size 1200 720,class:^(wechat)$,title:^(微信)$
windowrulev2 = float, class:^(wechat)$, title:^(朋友圈)$
windowrulev2 = float, class:^(wechat)$, title:^(预览)$
windowrule = float,QQ
windowrule = size 1024 640, QQ
# Float
windowrule = float, com.github.neithern.g4music
windowrule = size 1024 720, com.github.neithern.g4music
windowrulev2 = float, class:^(firefox)$, title:^(我的足迹)$
windowrule = float, mpv
windowrule = float, org.kde.kwrite
windowrule = float, xdg-desktop-portal-gtk
windowrule = float, tlpui
windowrulev2 = float, class:^(clash-verge)$, title:^(Clash Verge)$
windowrulev2 = size 1280 720, class:^(clash-verge)$, title:^(Clash Verge)$
windowrulev2 = float, class:^(rustdesk)$, title:^(RustDesk)$
windowrulev2 = float, class:^(rustdesk)$, title:^(rustdesk)$
windowrule = float, org.kde.ark
windowrule = float, galculator
windowrule = float, com.interversehq.qView
#windowrule = size 1280 720, com.interversehq.qView
windowrule = center, com.interversehq.qView
windowrulev2 = float, class:^(soffice)$, title:^(打开)$
# Clipboard
windowrulev2 = float, class:(clipse)
windowrulev2 = size 622 652, class:(clipse)
windowrulev2 = stayfocused, class:(clipse)
# localsend
windowrule = float, localsend
windowrule = size 480 720, localsend

最近编辑记录 chrisivanovic (2025-03-16 19:02:24)

离线

#2 2025-03-16 18:22:41

依云
会员
所在地: a.k.a. 百合仙子
注册时间: 2011-08-21
帖子: 9,168
个人网站

Re: [已解决]空载cpu占用率异常

htop 里确认用户态线程和内核线程都显示出来了。按 H 和 K 切换。

离线

#3 2025-03-16 18:25:09

GalaxySnail
会员
注册时间: 2023-09-10
帖子: 9

Re: [已解决]空载cpu占用率异常

另一方面有时候基于进程的  *top 就是可能捕捉不全信息,比如 autotools 的 configure 阶段这种执行 shell 脚本的场合。也许可以试试 systemd-cgtop 看看

离线

#4 2025-03-16 18:30:07

chrisivanovic
会员
注册时间: 2023-06-13
帖子: 80

Re: [已解决]空载cpu占用率异常

依云 说:

htop 里确认用户态线程和内核线程都显示出来了。按 H 和 K 切换。

都打开看过了, 没有异常的进程, hyprland占用5%, 火狐占用2-5%

离线

#5 2025-03-16 18:32:32

chrisivanovic
会员
注册时间: 2023-06-13
帖子: 80

Re: [已解决]空载cpu占用率异常

GalaxySnail 说:

另一方面有时候基于进程的  *top 就是可能捕捉不全信息,比如 autotools 的 configure 阶段这种执行 shell 脚本的场合。也许可以试试 systemd-cgtop 看看

可以, 看到了, 是rustdesk的进程, stop以后就正常了, 我去看看rustdesk的github去

最近编辑记录 chrisivanovic (2025-03-16 18:34:56)

离线

页脚