vital987 / chrome-novnc

Chromium via noVNC (Browser in Browser)
MIT License
81 stars 51 forks source link

High cpu usage #12

Open nankaine opened 3 weeks ago

nankaine commented 3 weeks ago

Thank you for sharing this tool. Currently, during usage, I've noticed that the CPU utilization remains high upon startup and persists for a while. Is there any optimization method available to address this?

vital987 commented 3 weeks ago

You're welcome. Please pinpoint the exact process consuming the memory resources. You can do this using top or htop.

nankaine commented 3 weeks ago

You're welcome. Please pinpoint the exact process consuming the memory resources. You can do this using top or htop.

hi. for this issue.

code.

docker run \
    --name chrome-novnc \
    -e PORT=8080 \
    -p 8080:8080 \
    -e VNC_PASS=CHANGE_IT \
    -d vital987/chrome-novnc:latest

usage.

CONTAINER ID   NAME           CPU %     MEM USAGE / LIMIT    MEM %     NET I/O           BLOCK I/O        PIDS
ca3808371c9d   chrome-novnc   100.72%   405.6MiB / 3.55GiB   11.16%    512kB / 35.8kB    407MB / 21.8MB   84

top

Mem: 3576692K used, 145552K free, 77596K shrd, 0K buff, 1222960K cached
CPU:  23% usr   3% sys   0% nic  72% idle   0% io   0% irq   0% sirq
Load average: 1.11 0.98 0.63 5/927 142
  PID  PPID USER     STAT   VSZ %VSZ CPU %CPU COMMAND
   28     1 root     R     459m  13%   0  25% {websockify} /usr/bin/python3 /usr/bin/websockify --cert /etc/ssl/novnc.cert --key /etc/ssl/novnc.key -D --web=/opt/novnc/ 8080 localhost:5900
   67    12 root     S    32.3g 907%   1   0% /usr/lib/chromium/chromium --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --no-sandbox --disable-dev-shm-usage --crashpad-handler-pid=30 --enable-crash-reporter=,Alpin
  101    36 root     S    1131g31695%   3   0% /usr/lib/chromium/chromium --type=renderer --crashpad-handler-pid=30 --enable-crash-reporter=,Alpine Linux --user-data-dir=/root/.config/chromium --change-stack-guard-on-fork=enable --no-sandbox --disable-dev-shm-usage --te
   99    36 root     SN   1131g31695%   2   0% /usr/lib/chromium/chromium --type=renderer --crashpad-handler-pid=30 --enable-crash-reporter=,Alpine Linux --user-data-dir=/root/.config/chromium --change-stack-guard-on-fork=enable --no-sandbox --disable-dev-shm-usage --te
   12     1 root     S    32.6g 914%   3   0% /usr/lib/chromium/chromium --user-data-dir=/root/.config/chromium --ozone-platform-hint=auto --no-sandbox --test-type --disable-dev-shm-usage --disable-gpu --start-maximized
  129    35 root     S    32.3g 907%   2   0% /usr/lib/chromium/chromium --type=gpu-process --no-sandbox --disable-dev-shm-usage --ozone-platform=x11 --crashpad-handler-pid=30 --enable-crash-reporter=,Alpine Linux --user-data-dir=/root/.config/chromium --change-stack-gu
   76    36 root     S    32.3g 907%   2   0% /usr/lib/chromium/chromium --type=utility --utility-sub-type=storage.mojom.StorageService --lang=en-US --service-sandbox-type=utility --no-sandbox --disable-dev-shm-usage --crashpad-handler-pid=30 --enable-crash-reporter=,Al
   35    12 root     S    32.3g 906%   2   0% /usr/lib/chromium/chromium --type=zygote --no-zygote-sandbox --no-sandbox --crashpad-handler-pid=30 --enable-crash-reporter=,Alpine Linux --user-data-dir=/root/.config/chromium --change-stack-guard-on-fork=enable
   36    12 root     S    32.3g 906%   3   0% /usr/lib/chromium/chromium --type=zygote --no-sandbox --crashpad-handler-pid=30 --enable-crash-reporter=,Alpine Linux --user-data-dir=/root/.config/chromium --change-stack-guard-on-fork=enable
   30     1 root     S    32.0g 896%   3   0% /usr/lib/chromium/chrome_crashpad_handler --monitor-self --monitor-self-annotation=ptype=crashpad-handler --database=/root/.config/chromium/Crash Reports --annotation=channel=Alpine Linux --annotation=lsb-release=Alpine Linu
   32     1 root     S    32.0g 896%   1   0% /usr/lib/chromium/chrome_crashpad_handler --no-periodic-tasks --monitor-self-annotation=ptype=crashpad-handler --database=/root/.config/chromium/Crash Reports --annotation=channel=Alpine Linux --annotation=lsb-release=Alpine
    8     1 root     S     213m   6%   3   0% Xvfb :0 -screen 0 1280x720x24 -nolisten unix
    1     0 root     S    28228   1%   3   0% {supervisord} /usr/bin/python3 /usr/bin/supervisord -l /var/log/supervisord.log -c /config/supervisord.conf
   27     1 root     S    25716   1%   2   0% x11vnc -usepw -rfbport 5900 -rfbauth /config/.xpass -geometry 1280x720 -forever -alwaysshared -permitfiletransfer -noxrecord -noxfixes -noxdamage -dpms -bg -desktop Chromium
    9     1 root     S    24484   1%   3   0% openbox
  136     0 root     S     1696   0%   3   0% sh
  142   136 root     R     1624   0%   2   0% top

env.

Rocky Linux release 9.2 (Blue Onyx)
Linux rocky-9-2- 5.14.0-284.11.1.el9_2.x86_64 #1 SMP PREEMPT_DYNAMIC Tue May 9 17:09:15 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

Add

i had a test.

I found,'3-vnc.conf' and '4-websockify.conf' will cause high cpu usage more than 10 minutes.

I can smoothly run KasmVNC Chrome on the same machine

vital987 commented 2 weeks ago

Hello, am bit busy in some other tasks so can't follow up with the issues. Can you run the old commit of the debian version and let me know if that's giving an issue?

As per this issue, it should've been fixed in the v0.9.16 but the commit only shows the ubuntu version being fixed. Also am not sure about it being the same issue.

One thing you can try is to limit the CPU & Memory usage of the docker container.

nankaine commented 2 weeks ago

Hello, am bit busy in some other tasks so can't follow up with the issues. Can you run the old commit of the debian version and let me know if that's giving an issue?

As per this issue, it should've been fixed in the v0.9.16 but the commit only shows the ubuntu version being fixed. Also am not sure about it being the same issue.

One thing you can try is to limit the CPU & Memory usage of the docker container.

OK. it's a good ideal.