Execute query, alpha takes up high memory and ends up OOM

About OOM https://dgraph.io/docs/deploy/troubleshooting/#running-out-of-memory-oom

Each Alpha needs to be in a single machine. 16GB for each, and I personally would suggest more RAM and CPU for you case as you use 17 mi nodes and does a complex query.

Also, bottleneck can be encountered when not using PCI-Express NVMe. Every part of your cluster needs to be carefully configured so there are no bottlenecks. If you have 200GB of RAM and little CPU it’s a crooked balance.

In your query, try as much as possible to break the query into several blocks. Avoid complex filters in a single block. Make a pipeline that sends to another block. That way your query will behave better because multiple blocks are executed concurrently.

Are you mutating at the same time as querying?

I think your query is too complex. Such a complex query I would do from time to time. If your application insists on complex queries every day, you’re going to need more resources than that.

In day to day running, the vast majority of applications do not make complex queries. Query for a user, for a post, for a message is usually what it takes. If this query is only for some internal dashboard of your enterprise. So the response time matches the complexity and the amount of resources available.