Skip to content

Extremely high CPU usage #1709

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

Closed
karimsa opened this issue May 22, 2020 · 11 comments
Closed

Extremely high CPU usage #1709

karimsa opened this issue May 22, 2020 · 11 comments
Labels
waiting-for-info Waiting for more information from submitter

Comments

@karimsa
Copy link

karimsa commented May 22, 2020

I'm seeing 200% CPU usage and 40 GB of virtual memory usage by Chrome when the code-server tab is open, almost consistently. Is there any advice on what settings for code-server can help lower the CPU usage?

  • Web Browser: Chrome 81.0.4044.138 (Official Build) (64-bit)
  • Local OS: macOS Catalina 10.15
  • Remote OS: docker running on Ubuntu 20.04 LTS
  • Remote Architecture: x86_64
  • code-server --version: 3.3.1 6f1309795e1cb930edba68cdc7c3dcaa01da0ab3
@nhooyr
Copy link
Contributor

nhooyr commented May 22, 2020

@nhooyr nhooyr added the waiting-for-info Waiting for more information from submitter label May 22, 2020
@nhooyr
Copy link
Contributor

nhooyr commented Jun 3, 2020

@karimsa Any luck?

@karimsa
Copy link
Author

karimsa commented Jun 4, 2020

I haven't had a chance to pull logs off the device yet. One thing I noticed is that the CPU spikes don't happen as often with the default log level as they do with a more verbose log level. Also, once I close the code-server tab for a bit and then open it again, the problem resolves.

I noticed that the processes in the shell seem to be tied to the browser's session. Is there a reason for that? Why isn't the shell + vscode state stored in the backend and then copied back over on reload?

@code-asher
Copy link
Member

I can't say for sure but it might be because you can use something like tmux or screen to persist your sessions. I haven't seen any open issues for persisting the terminals so it doesn't look like it's on the VS Code team's roadmap.

@rdelcorro
Copy link

I am also seeing one core pegged to 100% by node when I attach a browser to it. After I close the tab, the CPU is still maxed out.

Environment: linux
Running on docker image linuxserver/code-server:deadf647867b (latest)
image

Logs:

[2020-09-01T23:06:28.230Z] info  Using user-data-dir ~/data
[2020-09-01T23:06:28.235Z] info  code-server 3.5.0 de41646fc402b968ca6d555fdf2da7de9554d28a
[2020-09-01T23:06:28.242Z] info  HTTP server listening on http://0.0.0.0:8443
[2020-09-01T23:06:28.242Z] info    - No authentication
[2020-09-01T23:06:28.243Z] info    - Not serving HTTPS
[2020-09-01T23:06:28.243Z] info    - Proxying the following domain:
[2020-09-01T23:06:28.243Z] info      - <redacted>
Error: Could not locate the bindings file. Tried:
 → /node_modules/code-server/lib/vscode/node_modules/spdlog/build/spdlog.node
 → /node_modules/code-server/lib/vscode/node_modules/spdlog/build/Debug/spdlog.node
 → /node_modules/code-server/lib/vscode/node_modules/spdlog/build/Release/spdlog.node
 → /node_modules/code-server/lib/vscode/node_modules/spdlog/out/Debug/spdlog.node
 → /node_modules/code-server/lib/vscode/node_modules/spdlog/Debug/spdlog.node
 → /node_modules/code-server/lib/vscode/node_modules/spdlog/out/Release/spdlog.node
 → /node_modules/code-server/lib/vscode/node_modules/spdlog/Release/spdlog.node
 → /node_modules/code-server/lib/vscode/node_modules/spdlog/build/default/spdlog.node
 → /node_modules/code-server/lib/vscode/node_modules/spdlog/compiled/12.18.3/linux/x64/spdlog.node
 → /node_modules/code-server/lib/vscode/node_modules/spdlog/addon-build/release/install-root/spdlog.node
 → /node_modules/code-server/lib/vscode/node_modules/spdlog/addon-build/debug/install-root/spdlog.node
 → /node_modules/code-server/lib/vscode/node_modules/spdlog/addon-build/default/install-root/spdlog.node
 → /node_modules/code-server/lib/vscode/node_modules/spdlog/lib/binding/node-v72-linux-x64/spdlog.node
    at bindings (/node_modules/code-server/lib/vscode/node_modules/bindings/bindings.js:126:9)
    at Object.<anonymous> (/node_modules/code-server/lib/vscode/node_modules/spdlog/index.js:3:35)
    at Module._compile (internal/modules/cjs/loader.js:1137:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
    at Module.load (internal/modules/cjs/loader.js:985:32)
    at Function.Module._load (internal/modules/cjs/loader.js:878:14)
    at Module.require (internal/modules/cjs/loader.js:1025:19)
    at Module.patchedRequire [as require] (/node_modules/code-server/lib/vscode/node_modules/diagnostic-channel/dist/src/patchRequire.js:14:46)
    at require (internal/modules/cjs/helpers.js:72:18)
    at t.load (/node_modules/code-server/lib/vscode/out/vs/loader.js:16:749)
    at e.load (/node_modules/code-server/lib/vscode/out/vs/loader.js:13:941)
    at i (/node_modules/code-server/lib/vscode/out/vs/loader.js:29:839)
    at Object.errorback (/node_modules/code-server/lib/vscode/out/vs/loader.js:29:963)
    at e.triggerErrorback (/node_modules/code-server/lib/vscode/out/vs/loader.js:14:306)
    at /node_modules/code-server/lib/vscode/out/vs/loader.js:14:10
    at ReadFileContext.callback (/node_modules/code-server/lib/vscode/out/vs/loader.js:17:221)
    at FSReqCallback.readFileAfterOpen [as oncomplete] (fs.js:261:13) {
  tries: [
    '/node_modules/code-server/lib/vscode/node_modules/spdlog/build/spdlog.node',
    '/node_modules/code-server/lib/vscode/node_modules/spdlog/build/Debug/spdlog.node',
    '/node_modules/code-server/lib/vscode/node_modules/spdlog/build/Release/spdlog.node',
    '/node_modules/code-server/lib/vscode/node_modules/spdlog/out/Debug/spdlog.node',
    '/node_modules/code-server/lib/vscode/node_modules/spdlog/Debug/spdlog.node',
    '/node_modules/code-server/lib/vscode/node_modules/spdlog/out/Release/spdlog.node',
    '/node_modules/code-server/lib/vscode/node_modules/spdlog/Release/spdlog.node',
    '/node_modules/code-server/lib/vscode/node_modules/spdlog/build/default/spdlog.node',
    '/node_modules/code-server/lib/vscode/node_modules/spdlog/compiled/12.18.3/linux/x64/spdlog.node',
    '/node_modules/code-server/lib/vscode/node_modules/spdlog/addon-build/release/install-root/spdlog.node',
    '/node_modules/code-server/lib/vscode/node_modules/spdlog/addon-build/debug/install-root/spdlog.node',
    '/node_modules/code-server/lib/vscode/node_modules/spdlog/addon-build/default/install-root/spdlog.node',
    '/node_modules/code-server/lib/vscode/node_modules/spdlog/lib/binding/node-v72-linux-x64/spdlog.node'
  ],
  phase: 'loading',
  moduleId: 'spdlog',
  neededBy: [ '===anonymous3===' ]
}
[2020-09-01T23:06:48.093Z] warn  vscode ENOENT: no such file or directory, scandir '/config/data/logs'
(node:280) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 exit listeners added to [ChildProcess]. Use emitter.setMaxListeners() to increase limit
(node:280) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 error listeners added to [ChildProcess]. Use emitter.setMaxListeners() to increase limit

@code-asher
Copy link
Member

I'm not sure about the CPU usage but it might be worth fixing the spdlog issue to see if that affects anything. It looks like the Docker image might be missing some dependencies. https://github.com/Microsoft/vscode/wiki/How-to-Contribute#prerequisites

#1826 (comment) may also help, although it's specific to FreeBSD.

@nhooyr
Copy link
Contributor

nhooyr commented Sep 3, 2020

@code-asher I think the above issue is #1961

@code-asher
Copy link
Member

Ah yeah true there was mention there about spdlog in that issue. I don't really know what the bindings error actually means, I've just noticed it seems to get fixed if certain system dependencies are installed. I could see it being caused by issues with our packaging as well though.

@nhooyr
Copy link
Contributor

nhooyr commented Sep 4, 2020

Should also be noted that the above issue is occurring in linuxserver/code-server, not our image.

@nhooyr
Copy link
Contributor

nhooyr commented Dec 14, 2020

Anyone still seeing this on the latest releases?

@nhooyr
Copy link
Contributor

nhooyr commented Jan 18, 2021

Going to close as there hasn't been a response in a long time!

@nhooyr nhooyr closed this as completed Jan 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting-for-info Waiting for more information from submitter
Projects
None yet
Development

No branches or pull requests

4 participants