Unable to connect with dgraph-0.dgraph.dgraph.svc.cluster.local:7080

Dgraph is using a lot of memory to improve performance. Some problems with RAM are due to the way that Go handles the garbage collector. Try to balance the load on your alpha nodes. This can involve analyzing the queries that are being run and determining if there are any changes that can be made to distribute the workload more evenly across the nodes - the use of multiple blocks helps - Break your query as “pipelines”. Another example, you may want to consider whether all of the predicates in your cluster are being grouped together or if they can be divided into multiple groups. If you spread the predicates, this will help.

Badger has several configuration options that can affect memory usage, including the compression_level. If you set it to none might help.

Another option is to consider using the badger.tables flag to specify that the Badger LSM tree should be stored on disk rather than in RAM. This can help to reduce the amount of memory that Dgraph uses.

BTW, Dgraph keeps the full WAL in RAM. I’m not sure if we can remove this. The more data the w directory has, the more RAM it will use. But I’m not sure if we can control this. I believe not.

You can also try reducing the cache size by adjusting the cache_mb flag. By default, Dgraph sets the cache size to half of the available RAM, but you may be able to achieve better performance by setting it to a smaller value.

Please note that any changes to the parameters may have pros and cons. You should be aware that the default parameters have been chosen to keep the cluster performant.