Memurai Configuration
Memurai for Windows is compatible with the Redis®️* API version 7. This includes compatibility with the Redis 7 and Valkey 7 configuration file syntax, with a few differences as described below. Sample, self-documented configuration files can be found here:
- Memurai 4 compatible: Valkey 7 configuration
- Memurai 4 compatible: Redis 7 configuration
- Memurai 3 compatible: Redis 6 configuration
The configuration file is a text file that contains one keyword per line followed by one or multiple values:
keyword arg1 arg2 ... argN
Values can contain spaces if they are enclosed in double or single quotes:
logfile "C:\logs\memurai log.txt"
Since Memurai maintains compatibility with Redis and Valkey, values that represent a file or folder path can use either backslash \
or forward-slash /
:
logfile "C:/logs/memurai log.txt"
A common way to run Memurai is as a Windows service using a configuration file, but Memurai can also be executed as a standalone application with or without a configuration file. When running Memurai without a configuration file, a default built-in configuration is used. To start the server without a configuration file, run:
C:\Users\<username>\memurai.exe
Note: memurai.exe
doesn't have write access to its installation folder (e.g. C:\Program Files\Memurai\
) unless it is executed with administrator privileges, so it is recommended to launch the application from a working directory where the current user has read-write access. Read-write access to the working directory is needed when data persistence is enabled or to persist changes to the configuration file.
Note: when running Memurai as a standalone application, by default it uses the same port number 6379
that is used by the Memurai instance that runs as a Windows service (unless the default Windows service port number was changed or the Memurai Windows service install option was not chosen).
Therefore, make sure to run memurai.exe
passing a different port number or stop the Memurai Windows service instance if it's running.
To start Memurai with a custom configuration file, you can copy the provided default configuration file from the Memurai installation folder to a folder where the current user has read-write access, and make the desired changes there. To start the server, run:
C:\Users\<username>\memurai>memurai.exe memurai.conf
Memurai also supports passing configuration arguments from the command line. All the configuration settings available in the configuration file can be passed as command line arguments by simply prefixing the corresponding keywords with a double dash --
.
For example, to overwrite the default port
and logfile
settings without passing a configuration file:
C:\Users\<username>\memurai>memurai.exe --port 8000 --logfile "C:\logs\memurai-log.txt"
If a configuration file is specified, it must be the first command line argument. Any additional arguments will override the corresponding settings in the configuration file. Example:
C:\Users\<username>\memurai>memurai.exe memurai.conf --port 8000 --logfile "my-memurai-log.txt"
Configuration files can be nested using the include
keyword. If a flag is present in multiple files, the value in the included configuration file will override the value in the including configuration file.
Multiple instances of Memurai can be run at the same time, as long as they use different port numbers, log files and data files.
Changing configuration flags at runtime
Using the Memurai client memurai-cli.exe
, it's possible to change most configuration flags. The rules are the same as in Redis 7.
Differences with Redis & Valkey configuration flags
Unsupported configuration flags
Memurai supports all the flags, with the exception of these:
- always-show-logo
- activedefrag
- active-defrag-ignore-bytes
- active-defrag-threshold-lower
- active-defrag-threshold-upper
- active-defrag-cycle-min
- active-defrag-cycle-max
- daemonize
- supervised
- syslog-enabled
- syslog-ident
- syslog-facility
- unixsocket
- unixsocketperm
If any of these flags are present in a configuration file, they are simply ignored.
Memurai-specific configuration flags
The following configuration flags are Memurai-specific:
- instance-name
- winlog-level
instance-name
Specifies a name for the server instance. This is useful for distinguishing between multiple Memurai instances in the logs. If not empty, the value of instance-name is displayed at the beginning of every Windows Event Log message, and also in one of the first lines of the log file.
winlog-level
Specifies the verbosity level for the Windows Event Log. This flag does not impact the log file output. It is specific to the Event Log only. This can be one of:
debug
(a lot of information, useful for development/testing)verbose
(many rarely useful info, but not a mess like the debug level)notice
(moderately verbose, what you want in production probably)warning
(only very important / critical messages are logged)off
(no messages are logged)
Default configuration
If Memurai is started without a configuration file, it will assume default values for the flags it doesn't receive through the command-line. Here's a list of those values in config file format:
activerehashing yes
aof-load-truncated yes
aof-rewrite-incremental-fsync yes
aof-use-rdb-preamble yes
appendfsync everysec
appendonly no
auto-aof-rewrite-min-size 64mb
auto-aof-rewrite-percentage 100
client-output-buffer-limit normal 0 0 0
client-output-buffer-limit slave 268435456 67108864 60
client-output-buffer-limit pubsub 33554432 8388608 60
client-query-buffer-limit 1gb
cluster-announce-bus-port 0
cluster-announce-port 0
cluster-migration-barrier 1
cluster-node-timeout 15000
cluster-replica-no-failover no
cluster-replica-validity-factor 10
cluster-require-full-coverage yes
cluster-slave-no-failover no
cluster-slave-validity-factor 10
databases 16
dbfilename dump.rdb
dir {current working directory}
dynamic-hz yes
hash-max-ziplist-entries 512
hash-max-ziplist-value 64
hll-sparse-max-bytes 3000
hz 10
latency-monitor-threshold 0
lazyfree-lazy-eviction no
lazyfree-lazy-expire no
lazyfree-lazy-server-del no
lfu-decay-time 1
lfu-log-factor 10
list-compress-depth 0
list-max-ziplist-size -2
loglevel notice
lua-time-limit 5000
maxclients 10000
maxmemory 0
maxmemory-policy noeviction
maxmemory-samples 5
min-replicas-max-lag 10
min-replicas-to-write 0
min-slaves-max-lag 10
min-slaves-to-write 0
no-appendfsync-on-rewrite no
port 6379
protected-mode yes
proto-max-bulk-len 512mb
rdbchecksum yes
rdbcompression yes
rdb-save-incremental-fsync yes
repl-backlog-size 1mb
repl-backlog-ttl 3600
repl-disable-tcp-nodelay no
repl-diskless-sync no
repl-diskless-sync-delay 5
replica-announce-port 0
replica-ignore-maxmemory yes
replica-lazy-flush no
replica-priority 100
replica-read-only yes
replica-serve-stale-data yes
repl-ping-replica-period 10
repl-ping-slave-period 10
repl-timeout 60
save 900 1
save 300 10
save 60 10000
set-max-intset-entries 512
slave-announce-port 0
slave-ignore-maxmemory yes
slave-lazy-flush no
slave-priority 100
slave-read-only yes
slave-serve-stale-data yes
slowlog-log-slower-than 10000
slowlog-max-len 128
stop-writes-on-bgsave-error yes
stream-node-max-bytes 4096
stream-node-max-entries 100
tcp-backlog 511
tcp-keepalive 300
timeout 0
watchdog-period 0
winlog-level notice
zset-max-ziplist-entries 128
zset-max-ziplist-value 64