Skip to main content
This page provides a comprehensive reference for configuration flags used across YugabyteDB components. Flags allow you to customize behavior, tune performance, configure security, and manage resources.

Overview

YugabyteDB uses configuration flags (also called gflags) to control various aspects of database operation. Flags can be set for different components:
  • yb-master - Master server flags for cluster coordination
  • yb-tserver - Tablet server flags for data storage and processing
  • yugabyted - Simplified deployment utility flags

Flag Types

YugabyteDB flags are categorized by their runtime behavior:
Flag TypeDescriptionRestart Required
RUNTIMECan be changed at runtime using yb-adminNo
NON_RUNTIMERequires server restart to take effectYes
AUTOAuto-promoted flags for rolling upgradesVaries
UNKNOWNStability not yet determinedPotentially
TESTUsed for testing only, not for productionN/A

Setting Flags

Command Line

Set flags directly when starting a server:
./bin/yb-master --replication_factor=3 --fs_data_dirs=/data

Configuration File

Use a flagfile to store all flags:
# master.conf
--replication_factor=3
--fs_data_dirs=/data/master
--master_addresses=10.0.0.1:7100,10.0.0.2:7100,10.0.0.3:7100
Start with the flagfile:
./bin/yb-master --flagfile=/etc/yugabyte/master.conf

Runtime Modification

For RUNTIME flags, use yb-admin:
# Set a runtime flag on yb-tserver
yb-admin -master_addresses <master-addresses> \
  set_flag <tserver-host>:9100 <flag-name> <new-value>

# Example
yb-admin -master_addresses 10.0.0.1:7100 \
  set_flag 10.0.0.1:9100 rocksdb_compact_flush_rate_limit_bytes_per_sec 268435456

YugabyteDB Anywhere

If using YugabyteDB Anywhere, set flags through the Edit Flags feature in the UI.

Common Flag Categories

General Server Configuration

--version
flag
Display version and build information, then exit.
--flagfile
string
Path to configuration file containing flags.Example: --flagfile=/etc/yugabyte/master.conf
--max_clock_skew_usec
int64
Maximum expected clock skew between nodes in microseconds.Default: 500000 (500ms)Component: yb-master, yb-tserver
--time_source
string
Time source for the database. Set to clockbound for highly accurate time.Default: ""Valid values: "" (system), clockboundComponent: yb-master, yb-tserver
--rpc_bind_addresses
string
Comma-separated list of network addresses to bind for RPC.Default: Private IP of hostComponent: yb-master, yb-tserver
--server_broadcast_addresses
string
Public IP or DNS hostname for server-to-server communication.Default: ""Component: yb-master, yb-tserver
--dns_cache_expiration_ms
int32
Duration in milliseconds until cached DNS resolution expires.Default: 60000 (1 minute)Component: yb-master, yb-tserver
--use_private_ip
string
Policy for using private IPs: never, zone, region.Default: neverComponent: yb-master, yb-tserver
--fs_data_dirs
string
Comma-separated list of directories for data storage.Required: YesComponent: yb-master, yb-tserverExample: /data/disk1,/data/disk2,/data/disk3
--fs_wal_dirs
string
Comma-separated list of directories for write-ahead logs.Default: Same as --fs_data_dirsComponent: yb-master, yb-tserver
--rocksdb_block_cache_size_bytes
int64
Size of RocksDB block cache in bytes. -1 for automatic sizing.Default: -1Component: yb-tserver
--rocksdb_compact_flush_rate_limit_bytes_per_sec
int64
Rate limit for compaction and flush in bytes per second.Default: 256000000 (256 MB/s)Component: yb-tserver
--db_block_size_bytes
int32
Size of RocksDB data blocks in bytes.Default: 32768 (32 KB)Component: yb-tserver
--memory_limit_hard_bytes
int64
Maximum memory limit in bytes. 0 uses percentage of system RAM.Default: 0Component: yb-master, yb-tserver
--default_memory_limit_to_ram_ratio
double
Percentage of RAM to use when memory_limit_hard_bytes is 0.Default: 0.10 (10%)Component: yb-master, yb-tserver
--use_memory_defaults_optimized_for_ysql
boolean
Optimize memory defaults for YSQL workloads.Default: falseComponent: yb-master, yb-tserver
--log_dir
string
Directory for log files.Default: Same as --fs_data_dirsComponent: yb-master, yb-tserver
--max_log_size
int32
Maximum log file size in megabytes.Default: 1800 (1.8 GB)Component: yb-master, yb-tserver
--minloglevel
int32
Minimum log level: 0 (INFO), 1 (WARN), 2 (ERROR), 3 (FATAL).Default: 0Component: yb-master, yb-tserver
--logtostderr
boolean
Write logs to stderr instead of files.Default: falseComponent: yb-master, yb-tserver
--master_addresses
string
Comma-separated list of master RPC addresses.Required: Yes (yb-master)Component: yb-masterExample: 10.0.0.1:7100,10.0.0.2:7100,10.0.0.3:7100
--tserver_master_addrs
string
Comma-separated list of master addresses for tablet server.Required: Yes (yb-tserver)Component: yb-tserver
--replication_factor
int32
Number of replicas for each tablet.Default: 3Valid range: 1-7 (odd numbers recommended)Component: yb-master

YSQL Configuration

--enable_ysql
boolean
Enable YSQL API.Default: trueComponent: yb-master, yb-tserver
--ysql_pg_conf_csv
string
Comma-separated PostgreSQL configuration parameters.Component: yb-tserverExample: max_connections=200,shared_buffers=2GB
--ysql_enable_auth
boolean
Enable YSQL authentication.Default: falseComponent: yb-tserver
--ysql_hba_conf_csv
string
PostgreSQL host-based authentication rules.Component: yb-tserver
--enable_ysql_conn_mgr
boolean
Enable YSQL connection manager for connection pooling.Default: falseComponent: yb-tserver
--ysql_conn_mgr_port
uint32
Port for YSQL connection manager.Default: 5433Component: yb-tserver
--ysql_conn_mgr_max_pools
int32
Maximum number of connection pools.Default: 10000Component: yb-tserver

Performance Tuning

--scheduled_full_compaction_frequency_hours
int32
Frequency in hours for scheduled full compaction. 0 disables.Default: 0Component: yb-tserver
--auto_compact_percent_obsolete
double
Percentage of obsolete keys to trigger automatic compaction.Default: 99Component: yb-tserver
--auto_compact_min_obsolete_keys_found
uint32
Minimum obsolete keys for automatic compaction.Default: 10000Component: yb-tserver
--tablet_server_svc_queue_length
int32
Queue size for tablet server reads and writes.Default: 5000Component: yb-tserver
--master_svc_queue_length
int32
RPC queue length for master service.Default: 1000Component: yb-master
--heartbeat_interval_ms
int32
Interval between heartbeats to master in milliseconds.Default: 1000Component: yb-tserver
--heartbeat_rpc_timeout_ms
int32
Timeout for heartbeat RPC in milliseconds.Default: 15000Component: yb-tserver

Security

--use_client_to_server_encryption
boolean
Enable SSL/TLS for client-to-server communication.Default: falseComponent: yb-master, yb-tserver
--use_node_to_node_encryption
boolean
Enable SSL/TLS for node-to-node communication.Default: falseComponent: yb-master, yb-tserver
--certs_dir
string
Directory containing SSL certificates and keys.Default: ""Component: yb-master, yb-tserver
--allow_insecure_connections
boolean
Allow insecure connections when encryption is enabled.Default: trueComponent: yb-tserver
--webserver_certificate_file
string
SSL certificate file for web server (.pem format).Default: ""Component: yb-master, yb-tserver
--webserver_password_file
string
.htpasswd file for web server authentication.Default: ""Component: yb-master, yb-tserver

Flag Naming Conventions

YugabyteDB flags follow these naming patterns:
  • Component prefix: master_*, tserver_*, ysql_*, cql_*
  • Feature area: *_rpc_*, *_log_*, *_cache_*, *_compaction_*
  • Units: *_ms (milliseconds), *_bytes, *_mb, *_usec (microseconds)

Best Practices

Production Deployments

  1. Use flagfiles for configuration management
  2. Document all custom flags and their purpose
  3. Test flag changes in staging before production
  4. Monitor impact after flag changes
  5. Version control your flagfiles

Performance Tuning

  1. Start with defaults and measure baseline performance
  2. Change one flag at a time to isolate impact
  3. Monitor metrics before and after changes
  4. Document performance improvements for future reference

Common Flag Configurations

# yb-tserver flags for high-performance workloads
--tablet_server_svc_queue_length=10000
--rocksdb_compact_flush_rate_limit_bytes_per_sec=524288000
--rocksdb_block_cache_size_bytes=10737418240
--memory_limit_hard_bytes=21474836480

Viewing Current Flags

To view all current flag values:
# View yb-master flags
curl http://localhost:7000/varz

# View yb-tserver flags
curl http://localhost:9000/varz

See Also

Build docs developers (and LLMs) love