Skip to main content

Configuration File

ApertureDB uses a configuration file (following a JSON format) that can be specified when starting the server using the "-cfg" flag:

./aperturedb -cfg config.json

If no configuration file is specified, ApertureDB will try to open the default file (config.json), and will fail to initiate if the file is not found.

Parameters

All the parameters in the configuration file are optional, as ApertureDB has default values for all of them.

All parameters can also be specified as environment variables, using the prefix "ADB_" and the parameter name in upper case. For instance, the parameter "port" can be specified as "ADB_PORT", and the parameter "session_token_max_age_sec" can be specified as "ADB_SESSION_TOKEN_MAX_AGE_SEC".

Note that environment variables will override the values specified in the configuration file.

Here is the list of all supported parameters:

ParameterExplanationDefault
master_keyThe master key that initializes admin password on the first run."" (Range: any string)
portTCP port for incoming connections55555 (Range: 1-65535)
enable_health_portEnable/disable the health check portfalse (Range: true/false)
health_portTCP port for health checks55563 (Range: 1-65535)
timeout_receiveEnable/disable connection receive timeoutstrue (Range: true/false)
max_simultaneous_clientsNumber of max simultaneous connections open500 (Range: >= 1)
max_connection_message_size_mbMaximum size of the query/response message in MB. A value of 0 means use the default libcomm limit.0 (Range: >= 0)
force_sslFlag that indicates whether or not SSL-based communication will be enforced by the servertrue (Range: true/false)
db_root_pathPath to the root folder where all files/objects will be storeddb (Range: any valid path)
enable_dfsEnable/disable use of distributed file system / object store.false (Range: true/false)
log_pathDirectory where logs will be placed."/tmp" (Range: any valid path)
log_levelLevels INFO, WARNING, ERROR, and FATAL are 0, 1, 2, and 3, respectively1 (WARNING) (Range: 0-3)
verbose_log_levelVerbosity level beyond INFO, for debugging. Will set log_level = 0. Check Google glog documentation for details-1 (no verbosity beyond INFO) (Range: >= -1)
log_cerr_thresholdSpecify level of logging which will also be sent to stderr3 (FATAL) (Range: 0-3)
enable_audit_logsEnable/disable audit logsfalse (Range: true/false)
include_audit_logsWhen true, audit logs will be included in ApertureDB logsfalse (Range: true/false)
kvgd_db_sizeMaximum size of the graph database in MB10 (Range: > 0)
kvgd_db_syncEnable/disable sync operation to disk on every transaction. When disabled, latency will decrease but data loss may occur in case of crashtrue (Range: true/false)
locale_nameLocale used for string comparisonen_US (Range: any valid locale)
zk_serversComma-separated list of Zookeeper server:port"" (Range: any string)
zk_prefixSame instance of Zookeeper can be used by multiple aperturedb clusters. Each cluster uses a different prefix to provide isolation between clusters. The config parameter zk_prefix specifies the path for the instance."testing" (Range: any string)
checkpoints_to_keepNumber of checkpoints that will be kept for recovery4 (Range: > 0)
seconds_between_checkpointsInterval in seconds between checkpoints7200 (2 hours) (Range: > 0)
commits_between_checkpointsNumber of commits between checkpoints4096 (Range: > 0)
collect_thread_intervalNumber of seconds between collecting system status information1 (Range: > 0)
collect_interval_setAn array of look-back intervals, in seconds, over which system status information is averaged[5,10,30,120] (Range: array of ints 1-3600)
resources_check_mem_limitLimit on percentage of memory utilization after which queries are stopped93 (Range: 1-100)
resources_check_sleepNumber of seconds between resource utilization checks2 (Range: > 0)
batch_time_to_liveNumber of seconds that a batch is kept in memory before being cleaned up60 (Range: >= 0)
batch_cleaner_intervalNumber of seconds between batch cleanup operations10 (Range: >= 0)
descriptorset_flusher_intervalNumber of seconds between descriptor set cleanup operations1800 (Range: >= 0)
session_token_max_age_secMaximum duration of a session, in seconds36000 (Range: > 0)
refresh_token_max_age_secMaximum duration of a refresh token, in seconds360000 (Range: > 0)

Config File Example

Here is an example configuration file that has all the parameters with its default values. There is no need to specify any parameter if you want to work with default values.

// ApertureDB Config File
// All parameters show the default values.
{
// Network
"port": 55555,
"max_simultaneous_clients": 500,
"max_connection_message_size_mb": 0,
"force_ssl": true,

// DB paths
"db_root_path": "db",
"blobs_path": "db/blobs",
"images_path": "db/images",
"videos_path": "db/videos",
"descriptors_path": "db/descriptors",

// Log parameters
"log_path": "/tmp",
"log_level": 1, // Warnings only
"verbose_log_level": -1,
"log_cerr_threshold": 3,

// Batching parameters
"batch_cleaner_interval": 10,
"batch_time_to_live": 60,

// Resource Check parameters
"resources_check_sleep": 2,
"resources_check_mem_limit": 93,

// Telemetry collection parameters
"collect_thread_interval": 1,
"collect_interval_set": [5,10,30,120]

"more-info": "ApertureDB"
}

Default Directories Structure

By default, ApertureDB will create a directory structure as shown below:

db
├── acl
├── binlogs
├── descriptors
├── graph
├── objects
└── tmp