-
Notifications
You must be signed in to change notification settings - Fork 205
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
Provide easy configuration for limiting resource (mainly CPU) usage? #96
Comments
I've noticed memory usage can skyrocket which leads to swap & can bring the whole computer to a crawl. |
@binaryseed are you also using the @devonestes I do think that would be a good idea. Have you noticed any considerable performance impact of the server with those settings? Also do you have a link to the documentation of those settings? |
I'm running the latest |
Also those flags are documented here:
It can be configured during runtime too:
|
@axelson yes, this did help with my issues. The great thing about the BEAM is that it can efficiently use all your CPU cores, but that’s not really a property you want in a program running all the time on your personal/work computer because it starves out your other running programs - especially when it does meaningful work when it’s not actually in the “foreground,” unlike the hundred Chrome tabs most folks have open at any given time which are effectively idle in the background (unless they’re on a site like Slack or something). There hasn’t been a noticeable impact on the performance of Elixir-LS itself. At least I haven’t noticed it. I’m sure some things are slower, but for me this has only made things better. The easier thing to implement will probably be to have this configuration set with the system flag in the application boot, reading from a configuration file somewhere. That way it doesn’t need to pass arguments at boot, which will be easier for sure. |
Okay that makes sense. I'll try this out locally to see how it runs/feels for me. |
Seems like this worked for me, preliminary results are that it did not implode on a large project getting a lot of dependencies updated: in ~/.config/elixir_ls/setup.sh
Or it did nothing and I just didn't trigger dialyzer enough :) |
So what would y'all think about using something like I'm sure there's a way to hit Windows as well, getconf works for me on Mac and Linux. I figure this should be a default. I've had quite a few experiences where ElixirLS just reserves my machine for a few minutes for something I wasn't even actively doing which isn't the best experience. So far the script above seems to have solved my problem on this machine. |
Yeah I think that makes sense. Ideally we'd be able to change the schedulers after startup of the node (so we can support windows easily), but that doesn't seem possible. |
Actually it is possible:
I think that should make this change very easy |
This will make ElixirLS less resource-intensive because it isn't expected to be the only program running on the user's machine. Fixes elixir-lsp#96
I've marked #437 as fixing this since it will improve the behavior by default and it is already configurable via |
So it looks like it'll default to not using all of them if you have a bunch. This is absolitely fantastic. |
This will make ElixirLS less resource-intensive because it isn't expected to be the only program running on the user's machine. Fixes #96
Environment
I installed Elixir-LS a little bit ago, and I've noticed that it is a very resource intensive program. Since I usually leave vim open while doing other things, it will chew up a lot of CPU, making my computer relatively slow.
I was able to remedy this by editing the startup script to restrict the number of schedulers so that it was never taking up too much of my machine (now 2 cores out of the 8 available with
elixir --erl "+S 2:2" -e "ElixirLS.LanguageServer.CLI.main()"
), but I'm betting most Elixir users won't know how to do this, and it might affect their experience.Maybe it would be nice if there was a way to let users easily configure how much of their machine's CPU they want Elixir-LS to have access to?
The text was updated successfully, but these errors were encountered: