Server Configuration Flags
Dragonfly can be tuned and configured by a set of config flags. These flags can be:
- Passed to a Dragonfly as command line arguments. E.g,
dragonfly --port=6379. - Loaded from a file. E.g.
dragonfly --flagfile=path_to_flags/flags.txt - Can be set via env variables by adding the prefix
DFLY_followed by the flag name. E.g.export DFLY_port=6379(note it's case sensitive) - At runtime via
CONFIG SETcommand. Not all flags can be configured at runtime.
You can try dragonfly --helpfull to get a list of all flags or --help=substring shows help for
flags which include specified substring in either in the name, description or path.
Available Flags
--port
Redis port. 0 disables the port, -1 will bind on a random available port.
default: 6379
--cache_mode
If true, the backend behaves like a cache, by evicting entries when getting close to maxmemory limit
default: false
--cluster_mode
Set cluster mode. Available options are: yes, emulated and empty "".
default: ""
--maxmemory
Limit on maximum-memory that is used by the database. 0 - means the program will automatically determine its maximum memory usage.
default: 0
--dbnum
Number of databases.
default: 16
--bind
Bind address. If empty - binds on all interfaces. It's not advised due to security implications.
default: ""
--requirepass
Password for AUTH authentication.
default: ""
--dbfilename
The filename to save/load the DB.
default: "dump-{timestamp}"
--dir
Working directory
default: ""
--snapshot_cron
Cron expression for the time to save a snapshot, crontab style.
default:
--admin_bind
If set, the admin console TCP connection would be bind to the given address. This supports both HTTP and RESP protocols.
default: ""
--admin_port
If set, would enable admin access to console on the assigned port. This supports both HTTP and RESP protocols.
default: 0
--max_client_iobuf_len
Maximum io buffer length that is used to read client requests.
default: 64.0KiB
--max_multi_bulk_len
Maximum multi-bulk (array) length that is allowed to be accepted when parsing RESP protocol
default: 65536
--migrate_connections
When enabled, Dragonfly will try to migrate connections to the target thread on which they operate. Currently this is only supported for Lua script invocations, and can happen at most once per connection.
default: true
--no_tls_on_admin_port
Allow non-tls connections on admin port.
default: false
--publish_buffer_limit
Amount of memory to use for storing pub commands in bytes - per IO thread.
default: 128.00MiB
--pipeline_squash
Number of queued pipelined commands above which squashing is enabled, 0 means disabled.
default: 1
--primary_port_http_enabled
If true allows accessing http console on main TCP port.
default: true
--request_cache_limit
Amount of memory to use for request cache in bytes per IO thread.
default: 64.00MiB
--tcp_nodelay
Configures dragonfly connections with socket option TCP_NODELAY.
default: true
--conn_io_thread_start
Starting thread id for handling server connections.
default: 0
--conn_io_threads
Number of threads used for handing server connections.
default: 0
--conn_use_incoming_cpu
If true uses incoming cpu of a socket in order to distribute incoming connections.
default: false
--container_iteration_yield_interval_usec
Yield the fiber every N microseconds during container iteration. 0 disables yielding.
default: 0
--tcp_keepalive
The period in seconds of inactivity after which keep-alives are triggerred, the duration until an inactive connection is terminated is twice the specified time.
default: 300
--timeout
Close the connection after it is idle for N seconds (0 to disable).
default: 0
--tls
Enable tls.
default: false
--tls_ca_cert_dir
Certified authority signed certificates directory. Use c_rehash on the directory before specifying this flag.
default: ""
--tls_ca_cert_file
Certified authority signed certificate to validate tls connections.
default: ""
--tls_cert_file
Cert file(public key) for tls connections.
default: ""
--tls_key_file
Private Key file for tls connections.
default: ""
--rename_command
Change the name of commands, format is: <cmd1_name>=<cmd1_new_name>, <cmd2_name>=<cmd2_new_name>
default:
--restricted_commands
Commands restricted to connections on the admin port.
default:
--lock_on_hashtags
When true, locks are done in the {hashtag} level instead of key level. Only use this with --cluster_mode=emulated|yes.
default: false
--enable_heartbeat_eviction
Enable eviction during heartbeat when memory is under pressure.
default: true
--max_eviction_per_heartbeat
The maximum number of key-value pairs that will be deleted in each eviction when heartbeat based eviction is triggered under memory pressure.
default: 100
--max_segment_to_consider
The maximum number of dashtable segments to scan in each eviction when heartbeat based eviction is triggered under memory pressure.
default: 4
--force_epoll
If true - uses linux epoll engine underneath. Can fit for kernels older than 5.10.
default: false
--pidfile
If not empty - server writes its pid into the file).
default: ""
--unixsocket
If not empty - specifies path for the Unix socket that will be used for listening for incoming connections.
default: ""
--unixsocketperm
Set permissions for unixsocket, in octal value.
default: ""
--version_check
If true, Will monitor for new releases on Dragonfly servers once a day.
default: true
--hz
Base frequency at which the server performs other background tasks. Warning: not advised to decrease in production.
default: 100
--masterauth
Password for authentication with master.
default: ""
--replicaof
Specifies a host and port which point to a target master to replicate.
Format should be <IPv4>:<PORT> or host:<PORT> or [<IPv6>]:<PORT>.
default:
--mem_defrag_page_utilization_threshold
Memory page under utilization threshold. Ratio between used and committed size, below this, memory in this page will defragmented.
default: 0.8
--mem_defrag_threshold
Minimum percentage of used memory relative to maxmemory cap before running defragmentation.
default: 0.7
--mem_defrag_waste_threshold
The ratio of wasted/committed memory above which we run defragmentation.
default: 0.2
--shard_round_robin_prefix
When non-empty, keys which start with this prefix are not distributed across shards based on their value but instead via round-robin. Use cautiously! This can efficiently support up to a few hundreds of prefixes. Note: prefix is looked inside hashtags when cluster mode is enabled.
default: ""
--tiered_prefix
Enables tiered storage if set. The string denotes the path and prefix of the files associated
with tiered storage. For example, tiered_prefix=/path/to/file-prefix.
default: ""
--tiered_offload_threshold
Ratio of free memory (free/max memory) below which offloading starts
default: 0.5
--tiered_upload_threshold
Ratio of free memory (free/max memory) below which uploading stops.
default: 0.1
--tiered_min_value_size
Minimum size of values eligible for offloading. Must be at least 64
default: 64
--tiered_max_pending_stash_bytes
Maximum bytes in-flight to disk before rejecting new stashes or applying client backpressure. Allows batching writes to saturate disk I/O even with few clients.
default: 256.0KiB