2019-11-04 18:44:58 -08:00
|
|
|
import os
|
|
|
|
|
|
|
|
#==========================================================
|
|
|
|
# HOST LOGIN
|
|
|
|
#==========================================================
|
|
|
|
|
|
|
|
# Location of the database host relative to this driver
|
2020-04-23 00:46:58 -07:00
|
|
|
# Valid values: local, remote, docker or remote_docker
|
2019-11-04 18:44:58 -08:00
|
|
|
HOST_CONN = 'local'
|
|
|
|
|
|
|
|
# The name of the Docker container for the target database
|
|
|
|
# (only required if HOST_CONN = docker)
|
|
|
|
CONTAINER_NAME = None # e.g., 'postgres_container'
|
|
|
|
|
|
|
|
# Host SSH login credentials (only required if HOST_CONN=remote)
|
|
|
|
LOGIN_NAME = None
|
|
|
|
LOGIN_HOST = None
|
2020-04-23 00:46:58 -07:00
|
|
|
LOGIN_PASSWORD = None
|
2019-11-04 18:44:58 -08:00
|
|
|
LOGIN_PORT = None # Set when using a port other than the SSH default
|
|
|
|
|
|
|
|
|
|
|
|
#==========================================================
|
|
|
|
# DATABASE OPTIONS
|
|
|
|
#==========================================================
|
|
|
|
|
2020-04-23 00:46:58 -07:00
|
|
|
# Postgres, Oracle or Mysql
|
2019-11-04 18:44:58 -08:00
|
|
|
DB_TYPE = 'postgres'
|
|
|
|
|
|
|
|
# Name of the database
|
|
|
|
DB_NAME = 'tpcc'
|
|
|
|
|
|
|
|
# Database username
|
|
|
|
DB_USER = 'dbuser'
|
|
|
|
|
|
|
|
# Password for DB_USER
|
|
|
|
DB_PASSWORD = 'dbpassword'
|
|
|
|
|
2019-11-18 08:23:15 -08:00
|
|
|
# Database admin username (for tasks like restarting the database)
|
|
|
|
ADMIN_USER = DB_USER
|
|
|
|
|
2019-11-04 18:44:58 -08:00
|
|
|
# Database host address
|
|
|
|
DB_HOST = 'localhost'
|
|
|
|
|
|
|
|
# Database port
|
|
|
|
DB_PORT = '5432'
|
|
|
|
|
|
|
|
# Path to the configuration file on the database server
|
|
|
|
DB_CONF = '/etc/postgresql/9.6/main/postgresql.conf'
|
|
|
|
|
2019-11-04 19:47:19 -08:00
|
|
|
# Path to the directory for storing database dump files
|
2020-04-26 01:38:28 -07:00
|
|
|
DB_DUMP_DIR = None
|
2019-11-04 19:47:19 -08:00
|
|
|
|
2019-11-04 18:44:58 -08:00
|
|
|
# Base config settings to always include when installing new configurations
|
2020-04-23 00:46:58 -07:00
|
|
|
if DB_TYPE == 'mysql':
|
|
|
|
BASE_DB_CONF = {
|
|
|
|
'innodb_monitor_enable': 'all',
|
|
|
|
}
|
|
|
|
elif DB_TYPE == 'postgres':
|
|
|
|
BASE_DB_CONF = {
|
|
|
|
'track_counts': 'on',
|
|
|
|
'track_functions': 'all',
|
|
|
|
'track_io_timing': 'on',
|
|
|
|
'autovacuum': 'off',
|
|
|
|
}
|
|
|
|
else:
|
|
|
|
BASE_DB_CONF = None
|
2019-11-04 18:44:58 -08:00
|
|
|
|
|
|
|
# Name of the device on the database server to monitor the disk usage, or None to disable
|
|
|
|
DATABASE_DISK = None
|
|
|
|
|
|
|
|
# Set this to a different database version to override the current version
|
|
|
|
OVERRIDE_DB_VERSION = None
|
|
|
|
|
|
|
|
# POSTGRES-SPECIFIC OPTIONS >>>
|
|
|
|
PG_DATADIR = '/var/lib/postgresql/9.6/main'
|
|
|
|
|
|
|
|
# ORACLE-SPECIFIC OPTIONS >>>
|
|
|
|
ORACLE_AWR_ENABLED = False
|
2019-11-23 12:21:51 -08:00
|
|
|
ORACLE_FLASH_BACK = True
|
|
|
|
RESTORE_POINT = 'tpcc_point'
|
|
|
|
RECOVERY_FILE_DEST = '/opt/oracle/oradata/ORCL'
|
|
|
|
RECOVERY_FILE_DEST_SIZE = '15G'
|
2019-11-04 18:44:58 -08:00
|
|
|
|
|
|
|
|
|
|
|
#==========================================================
|
|
|
|
# DRIVER OPTIONS
|
|
|
|
#==========================================================
|
|
|
|
|
|
|
|
# Path to this driver
|
2019-11-04 19:47:19 -08:00
|
|
|
DRIVER_HOME = os.path.dirname(os.path.realpath(__file__))
|
2019-11-04 18:44:58 -08:00
|
|
|
|
|
|
|
# Path to the directory for storing results
|
|
|
|
RESULT_DIR = os.path.join(DRIVER_HOME, 'results')
|
|
|
|
|
2019-11-05 08:05:39 -08:00
|
|
|
# Path to temp directory
|
|
|
|
TEMP_DIR = '/tmp/driver'
|
|
|
|
|
2019-11-04 18:44:58 -08:00
|
|
|
# Path to the directory for storing database dump files
|
2020-04-23 00:46:58 -07:00
|
|
|
if DB_DUMP_DIR is None:
|
2020-04-26 01:38:28 -07:00
|
|
|
if HOST_CONN == 'local':
|
|
|
|
DB_DUMP_DIR = os.path.join(DRIVER_HOME, 'dumpfiles')
|
2020-04-26 01:57:04 -07:00
|
|
|
if not os.path.exists(DB_DUMP_DIR):
|
|
|
|
os.mkdir(DB_DUMP_DIR)
|
2020-04-26 01:38:28 -07:00
|
|
|
else:
|
2020-04-26 01:57:04 -07:00
|
|
|
DB_DUMP_DIR = os.path.expanduser('~/')
|
2019-11-04 18:44:58 -08:00
|
|
|
|
|
|
|
# Reload the database after running this many iterations
|
|
|
|
RELOAD_INTERVAL = 10
|
|
|
|
|
|
|
|
# The maximum allowable disk usage percentage. Reload the database
|
|
|
|
# whenever the current disk usage exceeds this value.
|
|
|
|
MAX_DISK_USAGE = 90
|
|
|
|
|
|
|
|
# Execute this many warmup iterations before uploading the next result
|
|
|
|
# to the website
|
|
|
|
WARMUP_ITERATIONS = 0
|
|
|
|
|
|
|
|
# Let the database initialize for this many seconds after it restarts
|
2020-04-23 00:46:58 -07:00
|
|
|
RESTART_SLEEP_SEC = 30
|
2019-11-04 18:44:58 -08:00
|
|
|
|
|
|
|
#==========================================================
|
|
|
|
# OLTPBENCHMARK OPTIONS
|
|
|
|
#==========================================================
|
|
|
|
|
|
|
|
# Path to OLTPBench directory
|
|
|
|
OLTPBENCH_HOME = os.path.expanduser('~/oltpbench')
|
|
|
|
|
|
|
|
# Path to the OLTPBench configuration file
|
|
|
|
OLTPBENCH_CONFIG = os.path.join(OLTPBENCH_HOME, 'config/tpcc_config_postgres.xml')
|
|
|
|
|
|
|
|
# Name of the benchmark to run
|
|
|
|
OLTPBENCH_BENCH = 'tpcc'
|
|
|
|
|
|
|
|
|
|
|
|
#==========================================================
|
|
|
|
# CONTROLLER OPTIONS
|
|
|
|
#==========================================================
|
|
|
|
|
|
|
|
# Path to the controller directory
|
2020-04-23 00:46:58 -07:00
|
|
|
CONTROLLER_HOME = DRIVER_HOME + '/../controller'
|
2019-11-04 18:44:58 -08:00
|
|
|
|
|
|
|
# Path to the controller configuration file
|
2020-04-26 01:38:28 -07:00
|
|
|
CONTROLLER_CONFIG = os.path.join(CONTROLLER_HOME, 'config/{}_config.json'.format(DB_TYPE))
|
2019-11-04 18:44:58 -08:00
|
|
|
|
|
|
|
|
|
|
|
#==========================================================
|
|
|
|
# LOGGING OPTIONS
|
|
|
|
#==========================================================
|
|
|
|
|
|
|
|
LOG_LEVEL = 'DEBUG'
|
|
|
|
|
|
|
|
# Path to log directory
|
|
|
|
LOG_DIR = os.path.join(DRIVER_HOME, 'log')
|
|
|
|
|
|
|
|
# Log files
|
|
|
|
DRIVER_LOG = os.path.join(LOG_DIR, 'driver.log')
|
|
|
|
OLTPBENCH_LOG = os.path.join(LOG_DIR, 'oltpbench.log')
|
|
|
|
CONTROLLER_LOG = os.path.join(LOG_DIR, 'controller.log')
|
|
|
|
|
|
|
|
|
|
|
|
#==========================================================
|
|
|
|
# WEBSITE OPTIONS
|
|
|
|
#==========================================================
|
|
|
|
|
|
|
|
# OtterTune website URL
|
|
|
|
WEBSITE_URL = 'http://127.0.0.1:8000'
|
|
|
|
|
|
|
|
# Code for uploading new results to the website
|
|
|
|
UPLOAD_CODE = 'I5I10PXK3PK27FM86YYS'
|