GOMEMLIMIT clarification

Description

The documentation for optimizing Weaviate performance mentions setting the GOMEMLIMIT env variable on Weaviate replicas to 10-20% of the total memory available on the host.

However, there is a blog post where it’s set to ~45% of the max RAM.

What factor am I actually looking at here to know how to set that optimally? Based on what’s said in that article (I may be misunderstanding), I would assume that I’d set it to close to the max RAM available, with a buffer of maybe 10%.

I’m also running Weaviate in a very controlled K8s environment where each replica gets its own node, so there are no other processes or anything involved. I suspect that also contributes to the recommendation.

Server Setup Information

  • Weaviate Server Version: 1.26.6
  • Deployment Method: k8s
  • Multi Node? Number of Running Nodes: 3
  • Client Language and Version: N/A
  • Multitenancy?: No

hi @elias.gabriel !

Nice catch!

Thank you VERY MUCH :hugs:

I checked with our team, and the recommendation is the other way around:

Setting GOMEMLIMIT between 90%-80% of your TOTAL memory. This room can be used for any exceeding memory that the runtime may require under pressure.

Certain specific cases may require a different configuration.

I will change that in our docs ASAP.

Thanks again!

Ah ok! I thought there was something I was really not understanding hahaha, so it being a typo makes a lot more sense!

Thanks for acting quickly.

1 Like

The document is not updated yet, is 80%-90% still valid for latest weaviate versoin?

  • GOMEMLIMIT: This sets the memory limit for the Go runtime, which should be around 10-20% of the total memory available for Weaviate. It controls the aggressiveness of the Garbage Collector as memory usage approaches this limit.

Hi!! Can you link this doc?

The one about env variables states:

Set the memory limit for the Go runtime. A suggested value is between 90-80% of your total memory for Weaviate. The Go runtime tries to make sure that long-lived and temporary memory allocations do not exceed this value by making the garbage collector more aggressive as the memory usage approaches the limit. Learn more about GOMEMLIMIT.

and yes, still valid!

So if you have 100G, you should set it between 80G and 90G.