Discussion Forum

Memory configuration in docker

Hi Grakn community,

In order to fix the memory consumption of Grakn in my docker image I try to find some documentation to setup the different XMS/XMX required to make it run in good condition.
For example if I have 16Go of memory to allowed to Grakn, that is the recommandation for every elements and how I can enforce the limit in configuration files or better in docker compose file?

Thanks in advance.

@max Can we supply environment variables such as SERVER_JAVAOPTS and STORAGE_JAVAOPTS into Grakn docker image?

@julien @ganesh it’s totally possible, please see an example here

Thanks for your answer @ganesh. Do you have any documentation for environment variables available? Any recommendation today for the setup of these 2 options ? Thanks

Hi @julien, you can start grakn giving the desired memory to either Grakn Server or to Grakn Storage (Cassandra) or both.

start Grakn with 16 GB of dedicated memory for the server:
SERVER_JAVAOPTS="-Xmx16G" grakn server start

start Grakn with 16 GB of dedicated memory for the storage (Cassandra):
STORAGE_JAVAOPTS="-Xmx16G" grakn server start

you can combine them with:
SERVER_JAVAOPTS="-Xmx16G" STORAGE_JAVAOPTS="-Xmx16G" ./grakn server start

Ok cool. Today what are the minimum requirement? 4Go for the server and 4Go for the storage ?

Yeah 4GB is a good start. It really depends a lot on the way you’re going to use Grakn. You could technically still run Grakn with 2GB, but if possible use >= 4GB

Thanks @marco and @ganesh, i have all the information i want :slight_smile: