memsql.cnf Settings¶
MemSQL uses a compatible extension of MySQL’s my.cnf file, called memsql.cnf.
Example Settings¶
The default memsql.cnf file included with MemSQL is as follows. For a basic MemSQL installation, you shouldn’t need to change these settings at all. (For a more customized installation, each setting is documented later on this page.)
[server]
; -----------------------------
; MemSQL configuration options:
; -----------------------------
; Possible values: on, off
; If durability is off, no data is saved to disk, but database
; and table definitions are persisted.
durability = on
; The transaction buffer is a per-database, in-memory buffer of the
; transaction log. By default, it is asynchronously flushed to disk.
; You can set it to 0 for synchronous durability (transactions are
; flushed on commit). A positive value sets the size of the buffer.
transaction-buffer = 128m
; snapshot-trigger-size indicates the size of the transaction
; log at which MemSQL starts a snapshot and truncates the log
snapshot-trigger-size = 2g
; ---------------------------------
; MySQL-style configuration options
; ---------------------------------
basedir = .
tmpdir = /tmp
lc-messages-dir = ./share
socket = /tmp/memsql.sock
port = 3306
lock_wait_timeout = 60
bind-address = 0.0.0.0
Description of Settings¶
The following table describes the memsql.cnf settings relevant to MemSQL.
| Setting | Functionality |
|---|---|
| durability = mode | Determines what data is persisted to disk. If set to on, MemSQL will take periodic snapshots and log intermediate changes. If set to off, MemSQL will persist only metadata to disk. Warning Do not set durability to off unless you have read and thoroughly understood the section Durability and Snapshots, and you know that you do not need durability. |
| transaction-buffer = size | The size of the in-memory buffer that holds data not yet flushed to disk. |
| snapshot-trigger-size = size | The amount of data to be logged between snapshots. |
| basedir = . | The path to the memsqlbin directory itself. |
| tmpdir = /tmp/ | Store temporary files in /tmp/ |
| core-file | Create a core file in $datadir if MemSQL crashes. It might be necessary to execute ulimit -c unlimited before starting the server to let the system generate large core files. The core files can be very large, so omit core-file if you don’t have much disk space available. |
| lc-messages-dir = ./share | Location of localized messages. |
| socket = /tmp/memsql.sock | Unix domain socket that memSQL listens on. |
| port = 3306 | TCP port that MemSQL listens on. Default is 3306, the standard MySQL port. |
| lock_wait_timeout = 60 | Time to wait (in seconds) on row-locks during insert transactions before aborting. |
| bind-address = 0.0.0.0 | IP address the server binds to. If you specify a value other than ‘0.0.0.0’, MemSQL will accept connections from only that address. |
