Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CPU usage 36 load average using studio code server after last update #884

Open
antoweb opened this issue Oct 7, 2024 · 12 comments
Open

Comments

@antoweb
Copy link

antoweb commented Oct 7, 2024

Problem/Motivation

After last update studio code server goes cpu of my raspberry at 36 load average and cause a force reboot of entire raspberry

Other problem is the port used for the new version is 1627 the same as Google Drive backup. And Google drive backup doesnt start (even if a ichange the port used)

Expected behavior

(What you expected to happen)

Actual behavior

(What actually happened)

Steps to reproduce

(How can someone else make/see it happen)

Proposed changes

(If you have a proposed change, workaround or fix,
describe the rationale behind it)

@SBRK
Copy link

SBRK commented Oct 7, 2024

I get this issue too. Whenever I launch vscode from the interface the CPU usage jumps up (and never comes down). If I launch another time it jumps again, until the instance becomes totally unresponsive and I have to hard reboot.

@antoweb antoweb changed the title CPU usage 36 load averag using studio code server after last update CPU usage 36 load average using studio code server after last update Oct 7, 2024
@D-Jeffrey
Copy link

image
The problem for me started on Oct 10 after installing HAOS Core 10.1
image
I have experience CPU anywhere from 0 to as high as 94% (X64) sustained on the Add-on CPU usage.

There are 'files not found' error messages in the log

s6-rc: info: service code-server successfully started
[10:56:28] INFO: Starting code-server...
s6-rc: info: service init-mosquitto successfully started
s6-rc: info: service legacy-services: starting
s6-rc: info: service legacy-services successfully started
[2024-10-14T16:56:31.072Z] info  Wrote default config file to /root/.config/code-server/config.yaml
[2024-10-14T16:56:31.430Z] info  code-server 4.93.1 69df01185ce2f80e99c9e4f8c8de1907cc7a9bc5
[2024-10-14T16:56:31.432Z] info  Using user-data-dir /data/vscode
[2024-10-14T16:56:31.476Z] info  Using config file /root/.config/code-server/config.yaml
[2024-10-14T16:56:31.476Z] info  HTTP server listening on http://0.0.0.0:1337/
[2024-10-14T16:56:31.477Z] info    - Authentication is disabled
[2024-10-14T16:56:31.477Z] info    - Not serving HTTPS
[2024-10-14T16:56:31.477Z] info  Session server listening on /data/vscode/code-server-ipc.sock
[10:57:21] 




[10:57:21] Extension host agent started.
File not found: /usr/local/lib/code-server/lib/vscode/out/vsda_bg.wasm
File not found: /usr/local/lib/code-server/lib/vscode/out/vsda.js
[10:57:23] [172.30.32.2][948d4343][ManagementConnection] New connection established.
[10:57:23] [172.30.32.2][38722cf6][ExtensionHostConnection] New connection established.
[10:57:27] [172.30.32.2][38722cf6][ExtensionHostConnection] <553> Launched Extension Host Process.
[10:57:49] [172.30.32.2][948d4343][ManagementConnection] The client has disconnected gracefully, so the connection will be disposed.
s6-rc: info: service legacy-services: stopping
s6-rc: info: service legacy-services successfully stopped
s6-rc: info: service init-mysql: stopping
s6-rc: info: service init-mosquitto: stopping
s6-rc: info: service code-server: stopping
s6-rc: info: service init-mysql successfully stopped
s6-rc: info: service init-mosquitto successfully stopped
a socket was left hanging
[10:59:21] INFO: Service code-server exited with code 0 (by signal 0)
s6-rc: info: service code-server successfully stopped
s6-rc: info: service init-user: stopping
s6-rc: info: service init-code-server: stopping
s6-rc: info: service init-user successfully stopped
s6-rc: info: service init-code-server successfully stopped
s6-rc: info: service legacy-cont-init: stopping
s6-rc: info: service legacy-cont-init successfully stopped
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service base-addon-timezone: stopping
s6-rc: info: service base-addon-log-level: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service base-addon-timezone successfully stopped
s6-rc: info: service base-addon-log-level successfully stopped
s6-rc: info: service base-addon-banner: stopping
s6-rc: info: service base-addon-banner successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped
s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service base-addon-banner: starting

-----------------------------------------------------------
 Add-on: Studio Code Server
 Fully featured Visual Studio Code (VSCode) experience integrated in the Home Assistant frontend.
-----------------------------------------------------------
 Add-on version: 5.17.1
 You are running the latest version of this add-on.
 System: Home Assistant OS 13.1  (amd64 / generic-x86-64)
 Home Assistant Core: 2024.10.2
 Home Assistant Supervisor: 2024.10.2
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
s6-rc: info: service base-addon-banner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service base-addon-timezone: starting
s6-rc: info: service base-addon-log-level: starting
s6-rc: info: service fix-attrs successfully started
[10:59:26] INFO: Configuring timezone (America/Edmonton)...
s6-rc: info: service base-addon-log-level successfully started
s6-rc: info: service base-addon-timezone successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service init-user: starting
s6-rc: info: service init-mysql: starting
s6-rc: info: service init-mosquitto: starting
s6-rc: info: service init-code-server: starting
s6-rc: info: service init-code-server successfully started
s6-rc: info: service init-mysql successfully started
s6-rc: info: service init-user successfully started
s6-rc: info: service code-server: starting
s6-rc: info: service code-server successfully started
[10:59:27] INFO: Starting code-server...
s6-rc: info: service init-mosquitto successfully started
s6-rc: info: service legacy-services: starting
s6-rc: info: service legacy-services successfully started
[2024-10-14T16:59:27.607Z] info  Wrote default config file to /root/.config/code-server/config.yaml
[2024-10-14T16:59:27.927Z] info  code-server 4.93.1 69df01185ce2f80e99c9e4f8c8de1907cc7a9bc5
[2024-10-14T16:59:27.929Z] info  Using user-data-dir /data/vscode
[2024-10-14T16:59:27.942Z] info  Using config file /root/.config/code-server/config.yaml
[2024-10-14T16:59:27.942Z] info  HTTP server listening on http://0.0.0.0:1337/
[2024-10-14T16:59:27.942Z] info    - Authentication is disabled
[2024-10-14T16:59:27.942Z] info    - Not serving HTTPS
[2024-10-14T16:59:27.943Z] info  Session server listening on /data/vscode/code-server-ipc.sock```


@mgorbach
Copy link

I am seeing the same thing. I've shut down the addon for now.

@AlexW75
Copy link

AlexW75 commented Oct 16, 2024

I experienced the same issue with the VSC installation after the latest HA update. I resolved it by updating all YAML files to the new syntax introduced in the recent HA update.

Once I corrected the code and VSC no longer showed any syntax errors, the problem disappeared.

In my case, I noticed a correlation between the number of errors in the files and CPU usage. After fixing the issues in the automation.yaml file (which had over 30 errors), CPU usage dropped from 8% to 4%. Once I resolved the errors in the rest of my files, the load returned to the original 0.2%.

Platform: X86 native on an i5 NUC

Improved YAML syntax for automations
Recently, we renamed service to action in the Home Assistant UI and YAML. This was done with the goal of making the syntax more natural, allowing it to be easier to grasp and read. We want to continue this work to improve the YAML syntax, this time focusing on automations, and we’ve made the following changes,

The top-level trigger key is now triggers (plural)
The top-level condition key is now conditions (plural)
The top-level action key is now actions (plural)
The platform key of a trigger definition is now trigger

The result of all this is that YAML automation syntax now has triggers with multiple trigger definitions, conditions with multiple condition definitions, and actions with multiple action definitions.

@SBRK
Copy link

SBRK commented Oct 17, 2024

I experienced the same issue with the VSC installation after the latest HA update. I resolved it by updating all YAML files to the new syntax introduced in the recent HA update.

Once I corrected the code and VSC no longer showed any syntax errors, the problem disappeared.

I'm not sure it's linked in my case. I had no file open, so (I assume) no syntax checking going on. I did manually fix my automations.yaml file, just to see, and I'm still getting high cpu usage even after closing VS Code.

I'm not even sure the syntax checking kicks on, if I hover a property in the yaml, it just says "Loading..." and I never see any error of any kind.

Copy link

There hasn't been any activity on this issue recently, so we clean up some of the older and inactive issues.
Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thanks!

@github-actions github-actions bot added the stale There has not been activity on this issue or PR for quite some time. label Nov 17, 2024
@marcobe
Copy link

marcobe commented Nov 17, 2024

Still happening on my install. My CPU usage goes from 1% to 8% with this thing running.

@emufan
Copy link

emufan commented Nov 18, 2024

Same here. As I updated from 2024.6 to .11 and in parallel HAOS and add-ons as well, I don't know, from where it is coming, but it is more than bad. The addon takes now more than more memory, never releases it back, add even more on re-opening it,

image

image

... Only add-on restart brings the memory back. The whole system gets otherwise more and more unresponsive, most probably because of memory swapping, etc.

Here a start of the VSC UI. 40%. And Core (blue) and Supervisor (green) got swapped to disk I think. Orange is total up to over 95% what is odfc not healthy for the stability.

image

I have already deleted the addon and re-installed from scratch. Same behavior.

Andy chance to get help here? See only unmaintained issues regarding this severe problem.

@github-actions github-actions bot removed the stale There has not been activity on this issue or PR for quite some time. label Nov 18, 2024
@GuyHarg
Copy link

GuyHarg commented Nov 18, 2024

Noticed mem use on my 4GB Pi5 rising sharply since yesterday and tracked it down to the VSCode addon which in Glances went from using ~75MB to peak at ~596MB before I uninstalled it and it went to zero. Reinstalled it and straight back up to ~425MB and climbing before I uninstalled it again. Also was getting unsecure access type messages when I opened it in WebUI. CPU use up to 18% as well.

@Lurker00
Copy link

Lurker00 commented Nov 21, 2024

I confirm that I have to restart VSC after every use of it, because it takes up to aroung 1GB of additional RAM and causes high CPU usage. Restart of VSC drops RAM/CPU back to normal until the next use.

But my Google Drive backup runs correctly.

Another observation is: restart of HA does not reclaim RAM used by VSC, but subsequent restart of VSC does. It means, VSC does not handle HA shutdown event to free resources.

@rhpijnacker
Copy link

Same problem here. Stopped using the addon for now, but I would love this to be fixed.

@davidrapan
Copy link

davidrapan commented Dec 2, 2024

Same. Now I have to stop the addon after every use.

Edit: Downgraded to 5.17.1 (CPU ~ 4%, but I also tried 5.16.0 and it seems to be even better in this regard ~ 1%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests