ThomasVon2021 / blikvm

Open and cost-effective "KVM-over-IP". BliKVM comes in 4 different models, v1 CM4, v2 PCIe, v3 HAT and v4 Allwinner, based on Raspberry Pi and Allwinner SoC.
https://thomasvon2021.github.io/blikvm/
GNU General Public License v3.0
355 stars 30 forks source link

Janus uses 100% CPU #144

Open phildabill opened 4 months ago

phildabill commented 4 months ago

On the last 2 releases, janus uses 100% cpu on a blikvm V1.

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 288 root 20 0 1571972 20020 17352 S 200.3 1.1 6:08.04 janus

blikvm@blikvm(ro):~$ ps -To pcpu,tid,comm -C janus | sort -r -k1 %CPU TID COMMAND 71.2 556 mixer 1234 71.0 552 mp 2 0.0 586 ws thread 0.0 574 MHD-single 0.0 573 http timer

What is mp 2?

ThomasVon2021 commented 4 months ago

Yes, I also noticed this phenomenon. After the device runs for a few minutes, the CPU usage rate will decrease. Since I generated this code directly using open-source compilation, I have not yet researched why the CPU usage rate in the first few minutes would reach 100%

ThomasVon2021 commented 4 months ago

Can you try ro start delay start janus. I tested that delaying Janus for 30 seconds can solve this problem. You can

sudo -s
cd /opt/bin/blikvm/package/janus
vim kvmd-janus.service

And add ExecStartPre=/bin/sleep 30 line:

[Unit]
Description=BLIKVM - janus controller daemon
After=busybox-syslogd.service

[Service]
Type=simple
User=root
ExecStartPre=/bin/sleep 30
ExecStart=/opt/janus/bin/janus &
RemainAfterExit=true
Restart=always

[Install]
WantedBy=local-fs.target 

Then reinstall.

bash install-kvmd-janus.sh
reboot

Please let me know if there has been any improvement in the test results.