Skip to main content
Version: 2.10.1

Configuration settings

Related - How-to

The main Memgraph configuration file is available in /etc/memgraph/memgraph.conf . You can modify that file to suit your specific needs. Additional configuration can be specified by including another configuration file, in a file pointed to by the MEMGRAPH_CONFIG environment variable or by passing arguments on the command line.

Each configuration setting is in the form: --setting-name=value.

You can check the current configuration by using the following query (privilege level CONFIG is required):

SHOW CONFIG;

If you are using a multi-tenant architecture, all isolated databases share identical configurations. At the moment, there is no way to specify a per-database configuration.

Bolt

FlagDescriptionType
--bolt-address=0.0.0.0IP address on which the Bolt server should listen.[string]
--bolt-cert-file=Certificate file which should be used for the Bolt server.[string]
--bolt-key-file=Key file which should be used for the Bolt server.[string]
--bolt-num-workers=Number of workers used by the Bolt server.
By default, this will be the number of processing units available on the machine.
[int32]
--bolt-port=7687Port on which the Bolt server should listen.[int32]
--bolt-server-name-for-init=Server name which the database should send to the client in the Bolt INIT message.[string]
--bolt-session-inactivity-timeout=1800Time in seconds after which inactive Bolt sessions will be closed.[int32]
note

Memgraph does not limit the maximum amount of simultaneous sessions. Transactions within all open sessions are served with a limited number of Bolt workers simultaneously.

Query

FlagDescriptionType
--query-callable-mappings-pathPath to the JSON file that contains possible alias mappings for query procedures in the form of key-value pairs.[string]
--query-cost-planner=trueUse the cost-estimating query planner.[bool]
--query-execution-timeout-sec=180Maximum allowed query execution time.
Queries exceeding this limit will be aborted. Value of 0 means no limit.
[uint64]
--query-max-plans=1000Maximum number of generated plans for a query.[uint64]
--query-modules-directory=/usr/lib/memgraph/query_modulesDirectory where modules with custom query procedures are stored. NOTE: Multiple comma-separated directories can be defined.[string]
--query-plan-cache-ttl=60Time to live for cached query plans, in seconds.[int32]
--query-vertex-count-to-expand-existing=10Maximum count of indexed vertices which provoke indexed lookup and then expand to existing,
instead of a regular expand. Default is 10, to turn off use -1.
[int64]

Storage

FlagDescriptionType
--storage-gc-cycle-sec=30Storage garbage collector interval (in seconds).[uint64]
--storage-properties-on-edges=trueControls whether edges have properties.[bool]
--storage-recover-on-startup=trueDeprecated and replaced with the data_recovery_on_startup flag. Controls whether the storage recovers persisted data on startup.[bool]
--storage-snapshot-interval-sec=300Storage snapshot creation interval (in seconds). Set to 0 to disable periodic snapshot creation.[uint64]
--storage-snapshot-on-exit=trueControls whether the storage creates another snapshot on exit.[bool]
--storage-snapshot-retention-count=3The number of snapshots that should always be kept.[uint64]
--storage-wal-enabled=trueControls whether the storage uses write-ahead-logging. To enable WAL periodic snapshots must be enabled.[bool]
--storage-wal-file-flush-every-n-tx=100000Issue a 'fsync' call after this amount of transactions are written to the WAL file. Set to 1 for fully synchronous operation.[uint64]
--storage-wal-file-size-kib=20480Minimum file size of each WAL file.[uint64]
--storage-items-per-batch=1000000The number of edges and vertices stored in a batch in a snapshot file.[uint64]
--storage-recovery-thread-count=The number of threads used to recover persisted data from disk.[uint64]
--storage-parallel-index-recovery=falseControls whether the index creation can be done in a multithreaded fashion during recovery.[bool]

Streams

FlagDescriptionType
--kafka-bootstrap-serversList of Kafka brokers as a comma separated list of broker host or host:port.[string]
--pulsar-service-urlThe service URL that will allow Memgraph to locate the Pulsar cluster.[string]
--stream-transaction-conflict-retries=30Number of times to retry a conflicting transaction of a stream.[uint32]
--stream-transaction-retry-interval=500The interval to wait (measured in milliseconds) before retrying to execute again a conflicting transaction.[uint32]

Other

FlagDescriptionType
--allow-load-csv=trueControls whether LOAD CSV clause is allowed in queries.[bool]
--also-log-to-stderr=falseLog messages go to stderr in addition to logfiles.[bool]
--data-directory=/var/lib/memgraphPath to directory in which to save all permanent data.[string]
--data_recovery_on_startup=trueFacilitates recovery of one or more individual databases and their contents during startup. Replaces --storage-recover-on-startup[bool]
--init-filePath to the CYPHERL file which contains queries that need to be executed before the Bolt server starts, such as creating users.[string]
--init-data-filePath to the CYPHERL file, which contains queries that need to be executed after the Bolt server starts.[string]
--isolation-level=SNAPSHOT_ISOLATIONIsolation level used for the transactions. Allowed values: SNAPSHOT_ISOLATION, READ_COMMITTED, READ_UNCOMMITTED.[string]
--log-file=/var/log/memgraph/memgraph.logPath to where the log should be stored.[string]
--log-level=WARNINGMinimum log level. Allowed values: TRACE, DEBUG, INFO, WARNING, ERROR, CRITICAL.[string]
--memory-limit=0Total memory limit in MiB. Set to 0 to use the default values which are 100% of the physical memory if the swap is enabled and 90% of the physical memory otherwise.[uint64]
--metrics-addressHost for HTTP server for exposing metrics.[string]
--metrics-portPort for HTTP server for exposing metrics.[uint64]
--memory-warning-threshold=1024Memory warning threshold, in MB. If Memgraph detects there is less available RAM it will log a warning.
Set to 0 to disable.
[uint64]
--password-encryption-algorithm=bcryptAlgorithm used for password encryption. Defaults to BCrypt. Allowed values: bcrypt, sha256, sha256-multiple (SHA256 with multiple iterations)[string]
--replication-replica-check-delay-secThe time duration in seconds between two replica checks/pings. If < 1, replicas will not be checked at all. The MAIN instance allocates a new thread for each REPLICA.[uint64]
--replication-restore-state-on-startupSet to true when initializing an instance to restore the replication role and configuration upon restart.[bool]
--telemetry-enabled=trueSet to true to enable telemetry. We collect information about the running system (CPU and memory information), information about the database runtime (vertex and edge counts and resource usage), and aggregated statistics about some features of the database (e.g. how many times a feature is used) to allow for an easier improvement of the product.[bool]

Environment variables

VariableDescriptionType
MEMGRAPH_USERUsername[string]
MEMGRAPH_PASSWORDUser password[string]
MEMGRAPH_PASSFILEPath to file that contains username and password for creating user. Data in file should be in format username:password if your username or password contains : just add \ before for example us\:ername:password[string]

Additional configuration inclusion

You can define additional configuration files in the main configuration file or within a Docker command in the terminal. Additional files are processed after the main configuration file and they override the main configuration file. Additional configuration files are specified with the --flag-file flag.

Example:

--flag-file=another.conf