-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Test and document use and performance of Go 1.19's GC memory limit #9327
Comments
Related: #8936 #8798 |
AFAIT go's soft memory limit will just run GC no matter what when you reach the limit. GC more often cost more CPU cycles "wasted". |
The current default configuration of kubo under high load tends to eat all the memory it can gets until it gets until killed by the OOM, causing frequent restarts of nodes and loss of connections and service. GOMEMLIMIT Does it work? |
My question exactly. Might be able to test over the coming weeks. |
Whether in production environments (so not in theory) Specifically, what I am hoping for is that Go will GC in time as to prevent OOM kills due to lingering garbage. Some more background: https://weaviate.io/blog/2022/08/GOMEMLIMIT-a-Game-Changer-for-High-Memory-Applications.html |
Well I've tested, it works very well, you can't magically half kubo's memory usage because as you get closer to GOMEMLIMIT the GC will run exponentially more often until it just run continously and performance is hot garbage. I've implemented a conservative limit that should still help there: #9451 |
@Jorropo This is awesome! I added the suggestion of maybe setting it based on the resource manager's memory limit. |
Checklist
Description
In addition to the upcoming Resource Manager, as of version 1.19, Golang has a built-in soft memory limit option, which tunes how the garbage collector operates within memory-constrained environments. This option can be set either using the
GOMEMLIMIT
environment varibale or by usingSetMemoryLimit
in theruntime/debug
package.The current default configuration of kubo under high load tends to eat all the memory it can gets until it gets until killed by the OOM, causing frequent restarts of nodes and loss of connections and service.
The new resource manager should be able to address some of these issues. However, documenting and testing Go's native soft memory limits could still significantly improve performance and/or memory usage, particularly under memory-constrained environments:
Note that 2. is written as could. Hence, my request is as follows:
SetMemoryLimit
when a memory limit is configured in the resource manager.The text was updated successfully, but these errors were encountered: