diff --git a/conf/pd.yml b/conf/pd.yml index 0aa190599..37cc5ba4c 100644 --- a/conf/pd.yml +++ b/conf/pd.yml @@ -5,11 +5,27 @@ global: # lease: 3 # tso-save-interval: "3s" + # namespace-classifier: "table" + + # enable-prevote: true + security: + # Path of file that contains list of trusted SSL CAs. if set, following four settings shouldn't be empty + # cacert-path: "" + # Path of file that contains X509 certificate in PEM format. + # cert-path: "" + # Path of file that contains X509 key in PEM format. + # key-path: "" log: #level: "info" + # log format, one of json, text, console + # format: "text" + + # disable automatic timestamps in output + # disable-timestamp: false + # file logging file: # max log file size in MB @@ -22,7 +38,7 @@ log: # log-rotate: true metric: - + schedule: # max-merge-region-size: 20 # max-merge-region-keys: 200000 diff --git a/conf/tidb.yml b/conf/tidb.yml index b637cab31..8c33b1851 100644 --- a/conf/tidb.yml +++ b/conf/tidb.yml @@ -7,9 +7,16 @@ global: # The socket file to use for connection. # socket: "" + # Run ddl worker on this tidb-server. + # run-ddl: true + # Schema lease duration, very dangerous to change only if you know what you do. # lease: "45s" + # When create table, split a separated region for it. It is recommended to + # turn off this option if there will be a large number of tables created. + # split-table: true + # The limit of concurrent executed sessions. # token-limit: 1000 @@ -20,6 +27,12 @@ global: # Set the memory quota for a query in bytes. Default: 32GB # mem-quota-query: 34359738368 + # Enable coprocessor streaming. + # enable-streaming: false + + # Set system variable 'lower_case_table_names' + # lower-case-table-names: 2 + # Make "kill query" behavior compatible with MySQL. It's not recommend to # turn on this option when TiDB server is behind a proxy. # compatible-kill-query: false @@ -31,25 +44,57 @@ log: # Log level: debug, info, warn, error, fatal. # level: "info" + # Log format, one of json, text, console. + # format: "text" + + # Disable automatic timestamps in output + # disable-timestamp: false + # Queries with execution time greater than this value will be logged. (Milliseconds) # slow-threshold: 300 # Queries with internal result greater than this value will be logged. # expensive-threshold: 10000 -status: - # TiDB status host. - # status-host = "0.0.0.0" + # Maximum query length recorded in log. + # query-log-max-len: 2048 + + # File logging. + file: + # Max log file size in MB. (upper limit to 4096MB). + # max-size: 300 + + # Max log file keep days. No clean up by default. + # max-days: 0 + + # Maximum number of old log files to retain. No clean up by default. + # max-backups: 0 + + # Rotate log by day + # log-rotate: true + +security: + # Path of file that contains list of trusted SSL CAs for connection with mysql client. + # ssl-ca: "" + + # Path of file that contains X509 certificate in PEM format for connection with mysql client. + # ssl-cert: "" - # Prometheus pushgateway address, leaves it empty will disable prometheus push. - # TiDB status port. - # status-port = 10080 + # Path of file that contains X509 key in PEM format for connection with mysql client. + # ssl-key: "" - # Prometheus pushgateway address, leaves it empty will disable prometheus push. - # metrics-addr = "" + # Path of file that contains list of trusted SSL CAs for connection with cluster components. + # cluster-ssl-ca: "" - # Prometheus client push interval in second, set \"0\" to disable prometheus push. - # metrics-interval = 15 + # Path of file that contains X509 certificate in PEM format for connection with cluster components. + # cluster-ssl-cert: "" + + # Path of file that contains X509 key in PEM format for connection with cluster components. + # cluster-ssl-key: "" + +status: + # If enable status report HTTP service. + # report-status: true performance: # Max CPUs to use, 0 use number of CPUs in the machine. @@ -61,10 +106,39 @@ performance: # StmtCountLimit limits the max count of statement inside a transaction. # stmt-count-limit: 5000 + # Set keep alive option for tcp connection. + # tcp-keep-alive: true + + # Whether support cartesian product. + # cross-join: true + # Stats lease duration, which influences the time of analyze and stats load. # stats-lease: "3s" + # Run auto analyze worker on this tidb-server. + # run-auto-analyze: true + + # Probability to use the query feedback to update stats, 0 or 1 for always false/true. + # feedback-probability: 0.05 + + # The max number of query feedback that cache in memory. + # query-feedback-limit: 1024 + + # Pseudo stats will be used if the ratio between the modify count and + # row count in statistics of a table is greater than it. + # pseudo-estimate-ratio: 0.8 + + # Force the priority of all statements in a specified priority. + # The value could be "NO_PRIORITY", "LOW_PRIORITY", "HIGH_PRIORITY" or "DELAYED". + # force-priority: "NO_PRIORITY" + proxy_protocol: + # PROXY protocol acceptable client networks. + # Empty string means disable PROXY protocol, * means all networks. + # networks: "" + + # PROXY protocol header read timeout, unit is second + # header-timeout: 5 prepared_plan_cache: # enabled: false @@ -150,6 +224,10 @@ tikv_client: # batch-wait-size: 8 txn_local_latches: + # Enable local latches for transactions. Enable it when + # there are lots of conflicts between transactions. + # enabled: false + # capacity: 2048000 binlog: # WriteTimeout specifies how long it will wait for writing binlog to pump. diff --git a/conf/tikv.yml b/conf/tikv.yml index ab14a8f49..b6fe36071 100644 --- a/conf/tikv.yml +++ b/conf/tikv.yml @@ -62,6 +62,9 @@ server: ## If not set, `addr` will be used. # advertise-addr: "" + ## Compression type for gRPC channel: none, deflate or gzip. + # grpc-compression-type: "none" + ## Size of the thread pool for the gRPC server. # grpc-concurrency: 4 @@ -160,6 +163,22 @@ metric: # job: "tikv" raftstore: + ## Whether to force to flush logs. + ## Set to `true` (default) for best reliability, which prevents data loss when there is a power + ## failure. Set to `false` for higher performance (ensure that you run multiple TiKV nodes!). + # sync-log: true + + ## Whether to enable Raft prevote. + ## Prevote minimizes disruption when a partitioned node rejoins the cluster by using a two phase + ## election. + # prevote: true + + ## The path to RaftDB directory. + ## If not set, it will be `{data-dir}/raft`. + ## If there are multiple disks on the machine, storing the data of Raft RocksDB on differen disks + ## can improve TiKV performance. + # raftdb-path: "" + ## Store capacity, i.e. max data size allowed. ## If it is not set, disk capacity is used. # capacity: 0 @@ -177,6 +196,31 @@ raftstore: ## Store heartbeat tick interval for reporting to PD. # pd-store-heartbeat-tick-interval: "10s" + ## The threshold of triggering Region split check. + ## When Region size change exceeds this config, TiKV will check whether the Region should be split + ## or not. To reduce the cost of scanning data in the checking process, you can set the value to + ## 32MB during checking and set it back to the default value in normal operations. + # region-split-check-diff: "6MB" + + ## The interval of triggering Region split check. + # split-region-check-tick-interval: "10s" + + ## When the number of Raft entries exceeds the max size, TiKV rejects to propose the entry. + # raft-entry-max-size: "8MB" + + ## Interval to GC unnecessary Raft log. + # raft-log-gc-tick-interval: "10s" + + ## Threshold to GC stale Raft log, must be >= 1. + # raft-log-gc-threshold: 50 + + ## When the entry count exceeds this value, GC will be forced to trigger. + # raft-log-gc-count-limit: 72000 + + ## When the approximate size of Raft log entries exceeds this value, GC will be forced trigger. + ## It's recommanded to set it to 3/4 of `region-split-size`. + # raft-log-gc-size-limit: "72MB" + ## How long the peer will be considered down and reported to PD when it hasn't been active for this ## time. # max-peer-down-duration: "5m" @@ -184,12 +228,33 @@ raftstore: ## Interval to check whether to start manual compaction for a Region. # region-compact-check-interval: "5m" + ## Number of Regions for each time to check. + # region-compact-check-step: 100 + + ## The minimum number of delete tombstones to trigger manual compaction. + # region-compact-min-tombstones: 10000 + + ## The minimum percentage of delete tombstones to trigger manual compaction. + ## It should be set between 1 and 100. Manual compaction is only triggered when the number of + ## delete tombstones exceeds `region-compact-min-tombstones` and the percentage of delete tombstones + ## exceeds `region-compact-tombstones-percent`. + # region-compact-tombstones-percent: 30 + + ## Interval to check whether to start a manual compaction for Lock Column Family. + ## If written bytes reach `lock-cf-compact-bytes-threshold` for Lock Column Family, TiKV will + ## trigger a manual compaction for Lock Column Family. + # lock-cf-compact-interval: "10m" + # lock-cf-compact-bytes-threshold: "256MB" + ## Interval (s) to check Region whether the data are consistent. # consistency-check-interval: 0 ## Delay time before deleting a stale peer. # clean-stale-peer-delay: "10m" + ## Interval to clean up import SST files. + # cleanup-import-sst-interval: "10m" + ## Use how many threads to handle log apply # apply-pool-size: 2 @@ -197,6 +262,26 @@ raftstore: # store-pool-size: 2 coprocessor: + ## When it is set to `true`, TiKV will try to split a Region with table prefix if that Region + ## crosses tables. + ## It is recommended to turn off this option if there will be a large number of tables created. + # split-region-on-table: true + + ## One split check produces several split keys in batch. This config limits the number of produced + ## split keys in one batch. + # batch-split-limit: 10 + + ## When Region [a,e) size exceeds `region_max_size`, it will be split into several Regions [a,b), + ## [b,c), [c,d), [d,e) and the size of [a,b), [b,c), [c,d) will be `region_split_size` (or a + ## little larger). + # region-max-size: "144MB" + # region-split-size: "96MB" + + ## When the number of keys in Region [a,e) exceeds the `region_max_keys`, it will be split into + ## several Regions [a,b), [b,c), [c,d), [d,e) and the number of keys in [a,b), [b,c), [c,d) will be + ## `region_split_keys`. + # region-max-keys: 1440000 + # region-split-keys: 960000 rocksdb: ## Maximum number of threads of RocksDB background jobs. @@ -219,6 +304,13 @@ rocksdb: ## `target_file_size_multiplier` for level-based compaction. # max-open-files: 40960 + ## Max size of RocksDB's MANIFEST file. + ## For detailed explanation, please refer to https://github.com/facebook/rocksdb/wiki/MANIFEST + # max-manifest-file-size: "128MB" + + ## If the value is `true`, the database will be created if it is missing. + # create-if-missing: true + ## RocksDB Write-Ahead Logs (WAL) recovery mode. ## 0 : TolerateCorruptedTailRecords, tolerate incomplete record in trailing data on all logs; ## 1 : AbsoluteConsistency, We don't expect to find any corruption in the WAL; @@ -272,6 +364,26 @@ rocksdb: ## Use O_DIRECT for both reads and writes in background flush and compactions. # use-direct-io-for-flush-and-compaction: false + ## Limit the disk IO of compaction and flush. + ## Compaction and flush can cause terrible spikes if they exceed a certain threshold. Consider + ## setting this to 50% ~ 80% of the disk throughput for a more stable result. However, in heavy + ## write workload, limiting compaction and flush speed can cause write stalls too. + ## 1. rate-bytes-per-sec is the only parameter you want to set most of the time. It controls the + ## total write rate of compaction and flush in bytes per second. Currently, RocksDB does not + ## enforce rate limit for anything other than flush and compaction, e.g. write to WAL. + ## 2. rate-limiter-mode indicates which types of operations count against the limit. + ## 1 : ReadOnly + ## 2 : WriteOnly + ## 3 : AllIo + ## 3. auto_tuned enables dynamic adjustment of rate limit within the range + ## [rate_bytes_per_sec / 20, rate_bytes_per_sec], according to the recent demand for background I/O. + # rate-bytes-per-sec: 0 + # rate-limiter-mode: 2 + # auto-tuned: false + + ## Enable or disable the pipelined write. + # enable-pipelined-write: true + ## Allows OS to incrementally sync files to disk while they are being written, asynchronously, ## in the background. # bytes-per-sync: "1MB" @@ -279,6 +391,44 @@ rocksdb: ## Allows OS to incrementally sync WAL to disk while it is being written. # wal-bytes-per-sync: "512KB" + ## Specify the maximal size of the RocksDB info log file. + ## If the log file is larger than this config, a new info log file will be created. + ## If it is set to 0, all logs will be written to one log file. + # info-log-max-size: "1GB" + + ## Time for the RocksDB info log file to roll (in seconds). + ## If the log file has been active longer than this config, it will be rolled. + ## If it is set to 0, rolling will be disabled. + # info-log-roll-time: "0" + + ## Maximal RocksDB info log files to be kept. + # info-log-keep-log-file-num: 10 + + ## Specifies the RocksDB info log directory. + ## If it is empty, the log files will be in the same directory as data. + ## If it is not empty, the log files will be in the specified directory, and the DB data directory's + ## absolute path will be used as the log file name's prefix. + # info-log-dir: "" + + ## Options for "Titan" + titan: + ## Enables `Titan. Note that Titan is still a experimental feature, once enabled it can't fallback, + ## or there will be some data loses. + ## default: false + # enabled: false + + ## Specifies `Titan` blob files directory + ## default: "titandb" (if not specific or empty) + # dirname: "" + + ## Disable blob file gc + ## default: false + # disable-gc: false + + ## Maximum number of threads of `Titan` background gc jobs. + ## default: 1 + # max-background-gc: 1 + ## Options for "Default" Column Family, which stores actual user data. defaultcf: ## Compression method (if any) is used to compress a block. @@ -318,6 +468,10 @@ rocksdb: ## memory usage and space amplification. # bloom-filter-bits-per-key: 10 + ## `false` means one SST file one bloom filter, `true` means every block has a corresponding bloom + ## filter. + # block-based-bloom-filter: false + # level0-file-num-compaction-trigger: 4 ## Soft limit on number of level-0 files. @@ -379,6 +533,14 @@ rocksdb: ## 3 : MinOverlappingRatio # compaction-pri: 3 + ## Indicating if we'd put index/filter blocks to the block cache. + ## If not specified, each "table reader" object will pre-load index/filter block during table + ## initialization. + # cache-index-and-filter-blocks: true + + ## Pin level-0 filter and index blocks in cache. + # pin-l0-filter-and-index-blocks: true + ## Enable read amplification statistics. ## value => memory usage (percentage of loaded blocks memory) ## 1 => 12.50 % @@ -388,6 +550,16 @@ rocksdb: ## 16 => 00.78 % # read-amp-bytes-per-bit: 0 + ## Pick target size of each level dynamically. + # dynamic-level-bytes: true + + ## Optimizes bloom filters. If true, RocksDB won't create bloom filters for the max level of + ## the LSM to reduce metadata that should fit in RAM. + ## This value is setted to true for `default` cf by default because its kv data could be determined + ## whether really exists by upper logic instead of bloom filters. But we suggest to set it to false + ## while using `Raw` mode. + # optimize-filters-for-hits: true + ## Options for "Titan" for "Default" Column Family titan: ## The smallest value to store in blob files. Value smaller than @@ -458,6 +630,7 @@ rocksdb: # compaction-pri: 3 # read-amp-bytes-per-bit: 0 # dynamic-level-bytes: true + # optimize-filters-for-hits: false lockcf: # compression-per-level: ["no", "no", "no", "no", "no", "no", "no"] @@ -467,6 +640,7 @@ rocksdb: # min-write-buffer-number-to-merge: 1 # max-bytes-for-level-base: "128MB" # target-file-size-base: "8MB" + # level0-file-num-compaction-trigger: 1 # level0-slowdown-writes-trigger: 20 # level0-stop-writes-trigger: 36 # cache-index-and-filter-blocks: true @@ -474,6 +648,7 @@ rocksdb: # compaction-pri: 0 # read-amp-bytes-per-bit: 0 # dynamic-level-bytes: true + # optimize-filters-for-hits: false raftdb: # max-background-jobs: 4 @@ -524,8 +699,17 @@ raftdb: # optimize-filters-for-hits: true security: + ## The path for TLS certificates. Empty string means disabling secure connections. + # ca-path: "" + # cert-path: "" + # key-path: "" import: + ## Number of threads to handle RPC requests. + # num-threads: 8 + + ## Stream channel window size, stream will be blocked on channel full. + # stream-channel-window: 128 pessimistic_txn: ## Enable pessimistic transaction diff --git a/roles/pd/vars/default.yml b/roles/pd/vars/default.yml index 597a80a8e..83c3d7060 100644 --- a/roles/pd/vars/default.yml +++ b/roles/pd/vars/default.yml @@ -19,11 +19,27 @@ global: lease: 3 tso-save-interval: "3s" + namespace-classifier: "table" + + enable-prevote: true + security: + # Path of file that contains list of trusted SSL CAs. if set, following four settings shouldn't be empty + cacert-path: "" + # Path of file that contains X509 certificate in PEM format. + cert-path: "" + # Path of file that contains X509 key in PEM format. + key-path: "" log: level: "info" + # log format, one of json, text, console + #format: "text" + + # disable automatic timestamps in output + #disable-timestamp: false + # file logging file: #filename: "" diff --git a/roles/tidb/vars/default.yml b/roles/tidb/vars/default.yml index 6e1af8cac..bb61a3944 100644 --- a/roles/tidb/vars/default.yml +++ b/roles/tidb/vars/default.yml @@ -19,9 +19,16 @@ global: # The socket file to use for connection. socket: "" + # Run ddl worker on this tidb-server. + run-ddl: true + # Schema lease duration, very dangerous to change only if you know what you do. lease: "45s" + # When create table, split a separated region for it. It is recommended to + # turn off this option if there will be a large number of tables created. + split-table: true + # The limit of concurrent executed sessions. token-limit: 1000 @@ -32,6 +39,12 @@ global: # Set the memory quota for a query in bytes. Default: 32GB # mem-quota-query: 34359738368 + # Enable coprocessor streaming. + enable-streaming: false + + # Set system variable 'lower_case_table_names' + lower-case-table-names: 2 + # Make "kill query" behavior compatible with MySQL. It's not recommend to # turn on this option when TiDB server is behind a proxy. compatible-kill-query: false @@ -43,24 +56,63 @@ log: # Log level: debug, info, warn, error, fatal. level: "info" + # Log format, one of json, text, console. + format: "text" + + # Disable automatic timestamp in output + disable-timestamp: false + + # Stores slow query log into separated files. + # slow-query-file: "" + # Queries with execution time greater than this value will be logged. (Milliseconds) slow-threshold: 300 # Queries with internal result greater than this value will be logged. expensive-threshold: 10000 -status: - # TiDB status host. - status-host: "0.0.0.0" + # Maximum query length recorded in log. + query-log-max-len: 2048 + + # File logging. + file: + # Log file name. + # filename: "" + + # Max log file size in MB (upper limit to 4096MB). + max-size: 300 + + # Max log file keep days. No clean up by default. + max-days: 0 + + # Maximum number of old log files to retain. No clean up by default. + max-backups: 0 + + # Rotate log by day + log-rotate: true + +security: + # Path of file that contains list of trusted SSL CAs for connection with mysql client. + ssl-ca: "" - # TiDB status port. - status-port: 10080 + # Path of file that contains X509 certificate in PEM format for connection with mysql client. + ssl-cert: "" - # Prometheus pushgateway address, leaves it empty will disable prometheus push. - metrics-addr: "" + # Path of file that contains X509 key in PEM format for connection with mysql client. + ssl-key: "" - # Prometheus client push interval in second, set \"0\" to disable prometheus push. - metrics-interval: 15 + # Path of file that contains list of trusted SSL CAs for connection with cluster components. + cluster-ssl-ca: "" + + # Path of file that contains X509 certificate in PEM format for connection with cluster components. + cluster-ssl-cert: "" + + # Path of file that contains X509 key in PEM format for connection with cluster components. + cluster-ssl-key: "" + +status: + # If enable status report HTTP service. + report-status: true performance: # Max CPUs to use, 0 use number of CPUs in the machine. @@ -72,11 +124,40 @@ performance: # StmtCountLimit limits the max count of statement inside a transaction. stmt-count-limit: 5000 + # Set keep alive option for tcp connection. + tcp-keep-alive: true + + # Whether support cartesian product. + cross-join: true + # Stats lease duration, which influences the time of analyze and stats load. stats-lease: "3s" + # Run auto analyze worker on this tidb-server. + run-auto-analyze: true + + # Probability to use the query feedback to update stats, 0 or 1 for always false/true. + feedback-probability: 0.05 + + # The max number of query feedback that cache in memory. + query-feedback-limit: 1024 + + # Pseudo stats will be used if the ratio between the modify count and + # row count in statistics of a table is greater than it. + pseudo-estimate-ratio: 0.8 + + # Force the priority of all statements in a specified priority. + # The value could be "NO_PRIORITY", "LOW_PRIORITY", "HIGH_PRIORITY" or "DELAYED". + force-priority: "NO_PRIORITY" + proxy_protocol: - + # PROXY protocol acceptable client networks. + # Empty string means disable PROXY protocol, * means all networks. + networks: "" + + # PROXY protocol header read timeout, unit is second + header-timeout: 5 + prepared_plan_cache: enabled: false capacity: 100 @@ -161,6 +242,10 @@ tikv_client: # batch-wait-size: 8 txn_local_latches: + # Enable local latches for transactions. Enable it when + # there are lots of conflicts between transactions. + enabled: false + capacity: 2048000 binlog: # Socket file to write binlog. diff --git a/roles/tikv/vars/default.yml b/roles/tikv/vars/default.yml index a05e94149..6dac74abe 100644 --- a/roles/tikv/vars/default.yml +++ b/roles/tikv/vars/default.yml @@ -62,6 +62,9 @@ server: ## If not set, `addr` will be used. # advertise-addr: "" + ## Compression type for gRPC channel: none, deflate or gzip. + # grpc-compression-type: "none" + ## Size of the thread pool for the gRPC server. # grpc-concurrency: 4 @@ -160,6 +163,22 @@ metric: # job: "tikv" raftstore: + ## Whether to force to flush logs. + ## Set to `true` (default) for best reliability, which prevents data loss when there is a power + ## failure. Set to `false` for higher performance (ensure that you run multiple TiKV nodes!). + sync-log: true + + ## Whether to enable Raft prevote. + ## Prevote minimizes disruption when a partitioned node rejoins the cluster by using a two phase + ## election. + # prevote: true + + ## The path to RaftDB directory. + ## If not set, it will be `{data-dir}/raft`. + ## If there are multiple disks on the machine, storing the data of Raft RocksDB on differen disks + ## can improve TiKV performance. + # raftdb-path: "" + ## Store capacity, i.e. max data size allowed. ## If it is not set, disk capacity is used. # capacity: 0 @@ -177,6 +196,31 @@ raftstore: ## Store heartbeat tick interval for reporting to PD. # pd-store-heartbeat-tick-interval: "10s" + ## The threshold of triggering Region split check. + ## When Region size change exceeds this config, TiKV will check whether the Region should be split + ## or not. To reduce the cost of scanning data in the checking process, you can set the value to + ## 32MB during checking and set it back to the default value in normal operations. + # region-split-check-diff: "6MB" + + ## The interval of triggering Region split check. + # split-region-check-tick-interval: "10s" + + ## When the number of Raft entries exceeds the max size, TiKV rejects to propose the entry. + # raft-entry-max-size: "8MB" + + ## Interval to GC unnecessary Raft log. + # raft-log-gc-tick-interval: "10s" + + ## Threshold to GC stale Raft log, must be >= 1. + # raft-log-gc-threshold: 50 + + ## When the entry count exceeds this value, GC will be forced to trigger. + # raft-log-gc-count-limit: 72000 + + ## When the approximate size of Raft log entries exceeds this value, GC will be forced trigger. + ## It's recommanded to set it to 3/4 of `region-split-size`. + # raft-log-gc-size-limit: "72MB" + ## How long the peer will be considered down and reported to PD when it hasn't been active for this ## time. # max-peer-down-duration: "5m" @@ -184,12 +228,33 @@ raftstore: ## Interval to check whether to start manual compaction for a Region. # region-compact-check-interval: "5m" + ## Number of Regions for each time to check. + # region-compact-check-step: 100 + + ## The minimum number of delete tombstones to trigger manual compaction. + # region-compact-min-tombstones: 10000 + + ## The minimum percentage of delete tombstones to trigger manual compaction. + ## It should be set between 1 and 100. Manual compaction is only triggered when the number of + ## delete tombstones exceeds `region-compact-min-tombstones` and the percentage of delete tombstones + ## exceeds `region-compact-tombstones-percent`. + # region-compact-tombstones-percent: 30 + + ## Interval to check whether to start a manual compaction for Lock Column Family. + ## If written bytes reach `lock-cf-compact-bytes-threshold` for Lock Column Family, TiKV will + ## trigger a manual compaction for Lock Column Family. + # lock-cf-compact-interval: "10m" + # lock-cf-compact-bytes-threshold: "256MB" + ## Interval (s) to check Region whether the data are consistent. # consistency-check-interval: 0 ## Delay time before deleting a stale peer. # clean-stale-peer-delay: "10m" + ## Interval to clean up import SST files. + # cleanup-import-sst-interval: "10m" + ## Use how many threads to handle log apply # apply-pool-size: 2 @@ -197,6 +262,26 @@ raftstore: # store-pool-size: 2 coprocessor: + ## When it is set to `true`, TiKV will try to split a Region with table prefix if that Region + ## crosses tables. + ## It is recommended to turn off this option if there will be a large number of tables created. + # split-region-on-table: true + + ## One split check produces several split keys in batch. This config limits the number of produced + ## split keys in one batch. + # batch-split-limit: 10 + + ## When Region [a,e) size exceeds `region_max_size`, it will be split into several Regions [a,b), + ## [b,c), [c,d), [d,e) and the size of [a,b), [b,c), [c,d) will be `region_split_size` (or a + ## little larger). + # region-max-size: "144MB" + # region-split-size: "96MB" + + ## When the number of keys in Region [a,e) exceeds the `region_max_keys`, it will be split into + ## several Regions [a,b), [b,c), [c,d), [d,e) and the number of keys in [a,b), [b,c), [c,d) will be + ## `region_split_keys`. + # region-max-keys: 1440000 + # region-split-keys: 960000 rocksdb: ## Maximum number of threads of RocksDB background jobs. @@ -219,6 +304,13 @@ rocksdb: ## `target_file_size_multiplier` for level-based compaction. # max-open-files: 40960 + ## Max size of RocksDB's MANIFEST file. + ## For detailed explanation, please refer to https://github.com/facebook/rocksdb/wiki/MANIFEST + # max-manifest-file-size: "128MB" + + ## If the value is `true`, the database will be created if it is missing. + # create-if-missing: true + ## RocksDB Write-Ahead Logs (WAL) recovery mode. ## 0 : TolerateCorruptedTailRecords, tolerate incomplete record in trailing data on all logs; ## 1 : AbsoluteConsistency, We don't expect to find any corruption in the WAL; @@ -272,6 +364,26 @@ rocksdb: ## Use O_DIRECT for both reads and writes in background flush and compactions. # use-direct-io-for-flush-and-compaction: false + ## Limit the disk IO of compaction and flush. + ## Compaction and flush can cause terrible spikes if they exceed a certain threshold. Consider + ## setting this to 50% ~ 80% of the disk throughput for a more stable result. However, in heavy + ## write workload, limiting compaction and flush speed can cause write stalls too. + ## 1. rate-bytes-per-sec is the only parameter you want to set most of the time. It controls the + ## total write rate of compaction and flush in bytes per second. Currently, RocksDB does not + ## enforce rate limit for anything other than flush and compaction, e.g. write to WAL. + ## 2. rate-limiter-mode indicates which types of operations count against the limit. + ## 1 : ReadOnly + ## 2 : WriteOnly + ## 3 : AllIo + ## 3. auto_tuned enables dynamic adjustment of rate limit within the range + ## [rate_bytes_per_sec / 20, rate_bytes_per_sec], according to the recent demand for background I/O. + # rate-bytes-per-sec: 0 + # rate-limiter-mode: 2 + # auto-tuned: false + + ## Enable or disable the pipelined write. + # enable-pipelined-write: true + ## Allows OS to incrementally sync files to disk while they are being written, asynchronously, ## in the background. # bytes-per-sync: "1MB" @@ -279,6 +391,44 @@ rocksdb: ## Allows OS to incrementally sync WAL to disk while it is being written. # wal-bytes-per-sync: "512KB" + ## Specify the maximal size of the RocksDB info log file. + ## If the log file is larger than this config, a new info log file will be created. + ## If it is set to 0, all logs will be written to one log file. + # info-log-max-size: "1GB" + + ## Time for the RocksDB info log file to roll (in seconds). + ## If the log file has been active longer than this config, it will be rolled. + ## If it is set to 0, rolling will be disabled. + # info-log-roll-time: "0" + + ## Maximal RocksDB info log files to be kept. + # info-log-keep-log-file-num: 10 + + ## Specifies the RocksDB info log directory. + ## If it is empty, the log files will be in the same directory as data. + ## If it is not empty, the log files will be in the specified directory, and the DB data directory's + ## absolute path will be used as the log file name's prefix. + # info-log-dir: "" + + ## Options for "Titan" + titan: + ## nables `Titan. Note that Titan is still a experimental feature, once enabled it can't fallback, + ## or there will be some data loses. + ## default: false + # enabled: false + + ## Specifies `Titan` blob files directory + ## default: "titandb" (if not specific or empty) + # dirname: "" + + ## Disable blob file gc + ## default: false + # disable-gc: false + + ## Maximum number of threads of `Titan` background gc jobs. + ## default: 1 + # max-background-gc: 1 + ## Options for "Default" Column Family, which stores actual user data. defaultcf: ## Compression method (if any) is used to compress a block. @@ -318,6 +468,10 @@ rocksdb: ## memory usage and space amplification. # bloom-filter-bits-per-key: 10 + ## `false` means one SST file one bloom filter, `true` means every block has a corresponding bloom + ## filter. + # block-based-bloom-filter: false + # level0-file-num-compaction-trigger: 4 ## Soft limit on number of level-0 files. @@ -379,6 +533,14 @@ rocksdb: ## 3 : MinOverlappingRatio # compaction-pri: 3 + ## Indicating if we'd put index/filter blocks to the block cache. + ## If not specified, each "table reader" object will pre-load index/filter block during table + ## initialization. + # cache-index-and-filter-blocks: true + + ## Pin level-0 filter and index blocks in cache. + # pin-l0-filter-and-index-blocks: true + ## Enable read amplification statistics. ## value => memory usage (percentage of loaded blocks memory) ## 1 => 12.50 % @@ -388,6 +550,16 @@ rocksdb: ## 16 => 00.78 % # read-amp-bytes-per-bit: 0 + ## Pick target size of each level dynamically. + # dynamic-level-bytes: true + + ## Optimizes bloom filters. If true, RocksDB won't create bloom filters for the max level of + ## the LSM to reduce metadata that should fit in RAM. + ## This value is setted to true for `default` cf by default because its kv data could be determined + ## whether really exists by upper logic instead of bloom filters. But we suggest to set it to false + ## while using `Raw` mode. + # optimize-filters-for-hits: true + ## Options for "Titan" for "Default" Column Family titan: ## The smallest value to store in blob files. Value smaller than @@ -458,6 +630,7 @@ rocksdb: # compaction-pri: 3 # read-amp-bytes-per-bit: 0 # dynamic-level-bytes: true + # optimize-filters-for-hits: false lockcf: # compression-per-level: ["no", "no", "no", "no", "no", "no", "no"] @@ -467,6 +640,7 @@ rocksdb: # min-write-buffer-number-to-merge: 1 # max-bytes-for-level-base: "128MB" # target-file-size-base: "8MB" + # level0-file-num-compaction-trigger: 1 # level0-slowdown-writes-trigger: 20 # level0-stop-writes-trigger: 36 # cache-index-and-filter-blocks: true @@ -474,6 +648,7 @@ rocksdb: # compaction-pri: 0 # read-amp-bytes-per-bit: 0 # dynamic-level-bytes: true + # optimize-filters-for-hits: false raftdb: # max-background-jobs: 4 @@ -524,8 +699,17 @@ raftdb: # optimize-filters-for-hits: true security: + ## The path for TLS certificates. Empty string means disabling secure connections. + # ca-path: "" + # cert-path: "" + # key-path: "" import: + ## Number of threads to handle RPC requests. + # num-threads: 8 + + ## Stream channel window size, stream will be blocked on channel full. + # stream-channel-window: 128 pessimistic_txn: ## Enable pessimistic transaction