How to set up resources usage limit for Weaviate embedded with python

Description

Hi I am using Weaviate embedded with python api v3, is there a way to set the resources usage limit, as I could not find this documented on the python Api so far, thanks

I am instantiating the weaviate client like this

client = weaviate.Client( embedded_options=weaviate.embedded.EmbeddedOptions( persistence_data_path=PERSISTANCE_PATH )

Server Setup Information

  • Weaviate Server Version: python v3
  • Deployment Method: embedded
  • Multi Node? Number of Running Nodes: no
  • Client Language and Version: api v3, python
  • Multitenancy?: no

Any additional Information

hi @wechwech !!

Welcome to our community :hugs:

What the Embedded installation method does is to run, on your host system, the weaviate go binary.

Because of that, you will need to tweak your host system on how to limit those resources.

That’s when tools like docker comes in, taking control of not only resource usage, but volumes, ports, etc.

You can, however, define some of the environment variables from Weaviate, like LIMIT_RESOURCES, GOMEMLIMIT and GOMAXPROCS

You can do that passing extra env vars like so:

client = weaviate.Client(
  embedded_options=EmbeddedOptions(
      additional_env_vars={
      "ENABLE_MODULES":
      "backup-s3,text2vec-openai,text2vec-cohere,text2vec-huggingface,ref2vec-centroid,generative-openai,qna-openai"}
  )
)

like described here: Embedded Weaviate | Weaviate - Vector Database

Note: we strongly suggest moving to python v4 code as it has a lot of improvements.

Let me know if this helps!

Thanks!

1 Like

Hi Duda,
thanks a lot, this clear to me, I will try that :raised_hands: