diff --git a/attention.md b/attention.md new file mode 100644 index 0000000..1b61023 --- /dev/null +++ b/attention.md @@ -0,0 +1,6 @@ +Attention + +1. Client/settings.py line6 用gitee git +2. 所有的tmp改成了raid +3. Client/settings.py line38 duration 600改成1 + diff --git a/client/.gitignore b/client/.gitignore index 0bb2702..36a4f82 100644 --- a/client/.gitignore +++ b/client/.gitignore @@ -1,2 +1,4 @@ .lock settings_local.py +settings.py + diff --git a/client/benchmarks/pgbench.py b/client/benchmarks/pgbench.py index 3cf2719..0b1012e 100644 --- a/client/benchmarks/pgbench.py +++ b/client/benchmarks/pgbench.py @@ -7,6 +7,9 @@ from numpy import mean, median, std from multiprocessing import cpu_count + +from collectors.scripts import ScriptCollector +from settings import SCRIPTS_DIR from utils.logging import log from utils.misc import available_ram, run_cmd @@ -17,9 +20,8 @@ class PgBench(object): # TODO allow running custom scripts, not just the default # read-write/read-only tests # TODO allow running 'prepared' mode - def __init__(self, bin_path, dbname, runs=3, duration=60, csv=False, - results_dir=None): + results_dir=None, benchmark_options=None): ''' bin_path - path to PostgreSQL binaries (dropdb, createdb, psql commands) @@ -40,6 +42,7 @@ def __init__(self, bin_path, dbname, runs=3, duration=60, csv=False, self._env['PATH'] = ':'.join([bin_path, self._env['PATH']]) self._results = {} + self._benchmark_options = benchmark_options @staticmethod def _configure(cpu_count, ram_mbs): @@ -76,10 +79,11 @@ def _init(self, scale): log("initializing pgbench '%s' with scale %s" % (self._dbname, scale)) r = run_cmd(['pgbench', '-i', '-s', str(scale), self._dbname], env=self._env, cwd=self._outdir) - # remember the init duration self._results['results']['init'] = r[2] + + @staticmethod def _parse_results(data): 'extract results (including parameters) from the pgbench output' @@ -170,7 +174,8 @@ def _run(self, run, scale, duration, nclients=1, njobs=1, read_only=False, rtag = "rw" rdir = "%s/pgbench-%s-%d-%d-%s" % (self._outdir, rtag, scale, nclients, str(run)) - os.mkdir(rdir) + if not(os.path.exists(rdir)): + os.mkdir(rdir) args = ['pgbench', '-c', str(nclients), '-j', str(njobs), '-T', str(duration)] @@ -205,16 +210,22 @@ def _run(self, run, scale, duration, nclients=1, njobs=1, read_only=False, return r - def run_tests(self, csv_queue): + def run_tests(self, csv_queue, benchmark_options=None): """ execute the whole benchmark, including initialization, warmup and benchmark runs """ # derive configuration for the CPU count / RAM size - configs = PgBench._configure(cpu_count(), available_ram()) + # if there is benchmark setting in settings.py, take it and use, + # otherwise use the default one + configs = [] + if benchmark_options: + configs.append(benchmark_options) + else: + configs = PgBench._configure(cpu_count(), available_ram()) - results = {'ro': {}, 'rw': {}} + results = {'ro': {}, 'rw': {}, 'customeScript': {}} j = 0 for config in configs: scale = config['scale'] @@ -223,6 +234,9 @@ def run_tests(self, csv_queue): results['ro'][scale] = {} if scale not in results['rw']: results['rw'][scale] = {} + # if scale not in results['customeScript']: + # results['customeScript'][scale] = {} + # init for the dataset scale and warmup self._init(scale) @@ -257,6 +271,33 @@ def run_tests(self, csv_queue): results[tag][scale][clients]['metric'] = mean(tps) results[tag][scale][clients]['median'] = median(tps) results[tag][scale][clients]['std'] = std(tps) + # todo add cmmand + # args = ['pgbench', '-c', str(nclients), '-j', str(njobs), '-T', + # str(duration)] + + script = ScriptCollector(scriptdirpath=SCRIPTS_DIR,env=self._env, dbname=self._dbname) + if script.hasScript(): + start = time.time() + scriptResult =script.run_custem_script() + + print('scriptResult ') + print(scriptResult) + end = time.time() + r = PgBench._parse_results(scriptResult[1]) + # r.update({'customeScript': read_only}) + # results[tag][scale][clients]['results'].append(r) + r.update({'start': start, 'end': end}) + + results['customeScript']['results']=[] + results['customeScript']['results'].append(r) + tps = [] + for result in results['customeScript']['results']: + tps.append(float(result['tps'])) + results['customeScript']['metric'] = mean(tps) + results['customeScript']['median'] = median(tps) + results['customeScript']['std'] = std(tps) + + results['customeScript']['scriptList'] = script.getScriptListJson() self._results['pgbench'] = results return self._results diff --git a/client/benchmarks/runner.py b/client/benchmarks/runner.py index 8544fac..39c736f 100644 --- a/client/benchmarks/runner.py +++ b/client/benchmarks/runner.py @@ -79,6 +79,7 @@ def _run_config(self, config_name): # construct the benchmark class for the given config name config = self._configs[config_name] bench = self._benchmarks[config['benchmark']] + benchmark_options = config['config']['benchmark_options'] # expand the attribute names bench = bench(**config['config']) @@ -91,6 +92,10 @@ def _run_config(self, config_name): # if requested output to CSV, create a queue and collector process csv_queue = None csv_collector = None + # somehow get the benchmarking options in settings.py + if benchmark_options: + options = benchmark_options + if 'csv' in config['config'] and config['config']['csv']: csv_queue = Queue() csv_collector = Process(target=csv_collect_results, @@ -98,7 +103,7 @@ def _run_config(self, config_name): csv_collector.start() # run the tests - r = bench.run_tests(csv_queue) + r = bench.run_tests(csv_queue, options) # notify the result collector to end and wait for it to terminate if csv_queue: @@ -116,16 +121,16 @@ def _run_config(self, config_name): uname = check_output(['uname', '-a']) r['meta'] = { - 'benchmark': config['benchmark'], - 'date': strftime("%Y-%m-%d %H:%M:%S.000000+00", gmtime()), - 'name': config_name, - 'uname': uname, + 'benchmark': config['benchmark'], + 'date': strftime("%Y-%m-%d %H:%M:%S.000000+00", gmtime()), + 'name': config_name, + 'uname': uname, } r['postgres'] = { - 'branch': config['branch'], - 'commit': config['commit'], - 'settings': config['postgres'], + 'branch': config['branch'], + 'commit': config['commit'], + 'settings': config['postgres'], } with open('%s/results.json' % self._output, 'w') as f: @@ -134,23 +139,25 @@ def _run_config(self, config_name): try: self._upload_results(r) except Exception as e: - print (e) + print(e) def _upload_results(self, results): - postdata = results - post = [] - post.append(postdata) - - headers = {'Content-Type': 'application/json; charset=utf-8', 'Authorization': self._secret} - r = requests.post(self._url.encode('utf-8'), data=json.dumps(post).encode('utf-8'), headers=headers) - + PATH_URL = 'upload/' + url = self._url + PATH_URL + headers = {'Authorization': self._secret} + files = { + 'json': (None, json.dumps(results), 'application/json'), + 'insert.sql': open('scripts/files/insert.sql', 'rb'), + 'test.sql': open('scripts/files/test.sql', 'rb') + } + r = requests.post(url.encode('utf-8'), files=files, headers=headers) def run(self): 'run all the configured benchmarks' # Removing the existing directory - + try: os.mkdir(self._output) except OSError as e: @@ -183,4 +190,4 @@ def csv_collect_results(bench_name, queue): # otherwise we expect the value to be a list, and we just print it results_file.write(bench_name + "\t" + "\t".join(v) + "\n") - results_file.flush() + results_file.flush() \ No newline at end of file diff --git a/client/benchmarks/test_upload_json.py b/client/benchmarks/test_upload_json.py new file mode 100644 index 0000000..4e2180c --- /dev/null +++ b/client/benchmarks/test_upload_json.py @@ -0,0 +1,13 @@ +import json +import requests + +url = 'http://127.0.0.1:8000/upload/' +secret = 'e984c3017cd1a0dff0ef9f0c394a5c285e421411' +headers = {'Content-Type': 'application/json; charset=utf-8', 'Authorization': secret} +with open("/home/guo/PythonClass/results_need.json", 'r') as load_f: + load_data = json.load(load_f) + postdata = load_data + post = [] + post.append(postdata) + +r = requests.post(url.encode('utf-8'), data=json.dumps(post).encode('utf-8'), headers=headers) diff --git a/client/benchmarks/test_upload_json_script.py b/client/benchmarks/test_upload_json_script.py new file mode 100644 index 0000000..a1bd83c --- /dev/null +++ b/client/benchmarks/test_upload_json_script.py @@ -0,0 +1,39 @@ +import json +import requests +import os + +url = 'http://127.0.0.1:8000/upload/' +secret = 'e984c3017cd1a0dff0ef9f0c394a5c285e421411' +headers = {'Authorization': secret} +# headers = {'Content-Type': 'application/json; charset=utf-8', 'Authorization': secret} +with open("/home/guo/PythonClass/results_script1.json", 'r') as load_f: + load_data = json.load(load_f) + print(load_data) + # postdata = load_data + # post = [] + # post.append(postdata) + +# files = { +# 'json': (None, json.dumps(load_data), 'application/json'), +# 'file': [ +# {(os.path.basename('insert.sql'), open('../scripts/files/insert.sql', 'rb'), 'application/octet-stream')}, +# {(os.path.basename('test.sql'), open('../scripts/files/test.sql', 'rb'), 'application/octet-stream')}] +# } + +files = { + 'json': (None, json.dumps(load_data), 'application/json'), + 'insert.sql': open('../scripts/files/insert.sql', 'rb'), + 'test.sql': open('../scripts/files/test.sql', 'rb') +} +# files = { +# 'json': (None, json.dumps(load_data), 'application/json'), +# 'file': (os.path.basename('insert.sql'), open('../scripts/files/insert.sql', 'rb'), 'application/octet-stream') +# } +# files = {'insert.sql': open('../scripts/files/insert.sql', 'rb'), +# 'test.sql': open('../scripts/files/test.sql', 'rb')} +# r = requests.post(url.encode('utf-8'), data=json.dumps(post).encode('utf-8'), files=files, headers=headers) +# r = requests.post(url.encode('utf-8'), data=load_data, files=files, headers=headers) +# r = requests.post(url.encode('utf-8'), data=(None, json.dumps(load_data), 'application/json'), files=files, headers=headers) +# r = requests.post(url.encode('utf-8'), data=json.dumps(load_data), files=files, headers=headers) + +r = requests.post(url.encode('utf-8'), files=files, headers=headers) \ No newline at end of file diff --git a/client/collectors/collectd.py b/client/collectors/collectd.py index 1cbe3b8..143983e 100644 --- a/client/collectors/collectd.py +++ b/client/collectors/collectd.py @@ -3,8 +3,8 @@ from utils.logging import log from utils.misc import run_cmd -COLLECTD_CONFIG = '/tmp/.collectd.conf' -COLLECTD_PIDFILE = '/tmp/.collectd.pid' +COLLECTD_CONFIG = '/raid/.collectd.conf' +COLLECTD_PIDFILE = '/raid/.collectd.pid' class CollectdCollector(object): diff --git a/client/collectors/postgres.py b/client/collectors/postgres.py index fb6a32d..8b0a4da 100644 --- a/client/collectors/postgres.py +++ b/client/collectors/postgres.py @@ -6,6 +6,8 @@ import time from multiprocessing import Process, Queue + +from settings_local import DATABASES from utils.logging import log from utils.misc import run_cmd @@ -24,7 +26,7 @@ def __init__(self, outdir, dbname, bin_path): def start(self): log("saving postgres settings") try: - conn = psycopg2.connect('host=localhost dbname=%s' % self._dbname) + conn = psycopg2.connect('dbname={} user={} password={} host=localhost'.format(DATABASES['default']['NAME'], DATABASES['default']['USER'],DATABASES['default']['PASSWORD'])) cur = conn.cursor(cursor_factory=psycopg2.extras.RealDictCursor) cur.execute( 'SELECT name, setting, source ' diff --git a/client/collectors/scripts.py b/client/collectors/scripts.py new file mode 100644 index 0000000..4d045cd --- /dev/null +++ b/client/collectors/scripts.py @@ -0,0 +1,59 @@ +import glob +import os.path +from utils.misc import run_cmd +import json + + +class ScriptCollector(object): + 'Collect various Linux-specific statistics (cpuinfo, mounts)' + + def __init__(self, scriptdirpath, env, dbname): + self._dirPath = scriptdirpath + self._env = env + self._dbname=dbname + self._scriptFileList = [] + self.hasScript() + + + + def hasScript(self): + isHasScript =False + if os.path.exists(self._dirPath): + self._scriptFileList = glob.glob(self._dirPath + "/*.sql") + if(len(self._scriptFileList) > 0): + isHasScript = True + return isHasScript + + + def _collect_scriptDir_info(self): + + + for script in self.sqlScript: + scriptObj = {} + scriptObj["scriptName"] = os.path.basename(script) + + + return scriptObj + + def run_custem_script(self): + args = ['pgbench'] + for script in self._scriptFileList: + print(script) + args.append('-f') + path = os.path.abspath(script) + args.append(path) + args.append(self._dbname) + + r = run_cmd(args, + env=self._env) + return r + + def getScriptListJson(self): + scriptList = [] + for script in self._scriptFileList: + scriptObj = {} + scriptObj["scriptName"] = os.path.basename(script) + scriptList.append(scriptObj) + result = json.dumps(scriptList) + print("collecting self-design script json: " + result) + return scriptList diff --git a/client/perffarm-client.py b/client/perffarm-client.py index a0e4c7d..008bba1 100644 --- a/client/perffarm-client.py +++ b/client/perffarm-client.py @@ -20,13 +20,14 @@ from settings_local import * from settings import * API_URL = 'http://127.0.0.1:8000/' -MACHINE_SECRET = '610f79063e62e6ad09460ac2c4e66da0386dc89b' +MACHINE_SECRET = 'e984c3017cd1a0dff0ef9f0c394a5c285e421411' + if __name__ == '__main__': with FileLock('.lock') as lock: if not(os.path.exists(REPOSITORY_PATH)): - os.mkdir(REPOSITORY_PATH) + os.makedirs(REPOSITORY_PATH) ''' if not(os.path.exists(BIN_PATH)): @@ -68,6 +69,10 @@ # register one config for each benchmark (should be moved to a config # file) PGBENCH_CONFIG['results_dir'] = OUTPUT_DIR + # register user options as config + if PGBENCH_BENCHMARKING_OPTIONS: + PGBENCH_CONFIG['benchmark_options'] = PGBENCH_BENCHMARKING_OPTIONS + runner.register_config('pgbench-basic', 'pgbench', repository.current_branch(), @@ -86,4 +91,4 @@ for v in issues[k]: print (k, ':', v) else: - runner.run() + runner.run() \ No newline at end of file diff --git a/client/post-example/new_result_linux.json b/client/post-example/new_result_linux.json new file mode 100644 index 0000000..f548edc --- /dev/null +++ b/client/post-example/new_result_linux.json @@ -0,0 +1,334 @@ +{ + "results": { + "init": 6.884479761123657, + "runs": [ + + ], + "warmup": null + }, + "pgbench": { + "ro": { + "10": { + "1": { + "results": [ + { + "scale": "10", + "mode": "simple", + "clients": "1", + "threads": "1", + "duration": "600", + "latency": -1, + "tps": "8368.570878", + "read-only": true, + "start": 1582334640.0761054, + "end": 1582335240.1133857, + "run": 0 + }, + { + "scale": "10", + "mode": "simple", + "clients": "1", + "threads": "1", + "duration": "600", + "latency": -1, + "tps": "5954.491250", + "read-only": true, + "start": 1582336440.8349092, + "end": 1582337040.87756, + "run": 1 + }, + { + "scale": "10", + "mode": "simple", + "clients": "1", + "threads": "1", + "duration": "600", + "latency": -1, + "tps": "5463.353203", + "read-only": true, + "start": 1582338241.4032373, + "end": 1582338841.4798918, + "run": 2 + } + ], + "metric": 6595.471777, + "median": 5954.49125, + "std": 1269.7019234917568 + }, + "2": { + "results": [ + { + "scale": "10", + "mode": "simple", + "clients": "2", + "threads": "2", + "duration": "600", + "latency": -1, + "tps": "23506.590718", + "read-only": true, + "start": 1582335240.5341868, + "end": 1582335840.562284, + "run": 0 + }, + { + "scale": "10", + "mode": "simple", + "clients": "2", + "threads": "2", + "duration": "600", + "latency": -1, + "tps": "13133.536904", + "read-only": true, + "start": 1582337041.0283606, + "end": 1582337641.1041396, + "run": 1 + }, + { + "scale": "10", + "mode": "simple", + "clients": "2", + "threads": "2", + "duration": "600", + "latency": -1, + "tps": "12971.834018", + "read-only": true, + "start": 1582338841.6099112, + "end": 1582339441.6769211, + "run": 2 + } + ], + "metric": 16537.320546666666, + "median": 13133.536904, + "std": 4928.460340824005 + }, + "4": { + "results": [ + { + "scale": "10", + "mode": "simple", + "clients": "4", + "threads": "4", + "duration": "600", + "latency": -1, + "tps": "19292.168411", + "read-only": true, + "start": 1582335840.6818783, + "end": 1582336440.7098997, + "run": 0 + }, + { + "scale": "10", + "mode": "simple", + "clients": "4", + "threads": "4", + "duration": "600", + "latency": -1, + "tps": "13780.866813", + "read-only": true, + "start": 1582337641.2354076, + "end": 1582338241.2711825, + "run": 1 + }, + { + "scale": "10", + "mode": "simple", + "clients": "4", + "threads": "4", + "duration": "600", + "latency": -1, + "tps": "14006.914512", + "read-only": true, + "start": 1582339441.797281, + "end": 1582340041.8300474, + "run": 2 + } + ], + "metric": 15693.316578666665, + "median": 14006.914512, + "std": 2546.445270551681 + } + } + }, + "rw": { + "10": { + "1": { + "results": [ + { + "scale": "10", + "mode": "simple", + "clients": "1", + "threads": "1", + "duration": "600", + "latency": -1, + "tps": "383.899583", + "read-only": false, + "start": 1582340041.971517, + "end": 1582340642.0268254, + "run": 0 + }, + { + "scale": "10", + "mode": "simple", + "clients": "1", + "threads": "1", + "duration": "600", + "latency": -1, + "tps": "468.254741", + "read-only": false, + "start": 1582341856.2022789, + "end": 1582342456.242233, + "run": 1 + }, + { + "scale": "10", + "mode": "simple", + "clients": "1", + "threads": "1", + "duration": "600", + "latency": -1, + "tps": "440.478110", + "read-only": false, + "start": 1582343668.8820202, + "end": 1582344268.9234486, + "run": 2 + } + ], + "metric": 430.87747800000005, + "median": 440.47811, + "std": 35.100591366346045 + }, + "2": { + "results": [ + { + "scale": "10", + "mode": "simple", + "clients": "2", + "threads": "2", + "duration": "600", + "latency": -1, + "tps": "696.802944", + "read-only": false, + "start": 1582340648.991153, + "end": 1582341249.0406718, + "run": 0 + }, + { + "scale": "10", + "mode": "simple", + "clients": "2", + "threads": "2", + "duration": "600", + "latency": -1, + "tps": "712.941145", + "read-only": false, + "start": 1582342458.787623, + "end": 1582343058.8303761, + "run": 1 + }, + { + "scale": "10", + "mode": "simple", + "clients": "2", + "threads": "2", + "duration": "600", + "latency": -1, + "tps": "689.276564", + "read-only": false, + "start": 1582344274.9807756, + "end": 1582344875.0531003, + "run": 2 + } + ], + "metric": 699.673551, + "median": 696.802944, + "std": 9.871959848909668 + }, + "4": { + "results": [ + { + "scale": "10", + "mode": "simple", + "clients": "4", + "threads": "4", + "duration": "600", + "latency": -1, + "tps": "926.816343", + "read-only": false, + "start": 1582341250.7739828, + "end": 1582341850.8290076, + "run": 0 + }, + { + "scale": "10", + "mode": "simple", + "clients": "4", + "threads": "4", + "duration": "600", + "latency": -1, + "tps": "866.745712", + "read-only": false, + "start": 1582343064.4830785, + "end": 1582343664.5334005, + "run": 1 + }, + { + "scale": "10", + "mode": "simple", + "clients": "4", + "threads": "4", + "duration": "600", + "latency": -1, + "tps": "935.881352", + "read-only": false, + "start": 1582344883.3326917, + "end": 1582345483.3744502, + "run": 2 + } + ], + "metric": 909.8144689999999, + "median": 926.816343, + "std": 30.67824385658676 + } + } + } + }, + "linux": { + "sysctl": "abi.vsyscall32 = 1\ndebug.exception-trace = 1\ndebug.kprobes-optimization = 1\ndev.cdrom.autoclose = 1\ndev.cdrom.autoeject = 0\ndev.cdrom.check_media = 0\ndev.cdrom.debug = 0\ndev.cdrom.info = CD-ROM information, Id: cdrom.c 3.20 2003/12/17\ndev.cdrom.info = \ndev.cdrom.info = drive name:\t\tsr0\ndev.cdrom.info = drive speed:\t\t32\ndev.cdrom.info = drive # of slots:\t1\ndev.cdrom.info = Can close tray:\t\t1\ndev.cdrom.info = Can open tray:\t\t1\ndev.cdrom.info = Can lock tray:\t\t1\ndev.cdrom.info = Can change speed:\t1\ndev.cdrom.info = Can select disk:\t0\ndev.cdrom.info = Can read multisession:\t1\ndev.cdrom.info = Can read MCN:\t\t1\ndev.cdrom.info = Reports media changed:\t1\ndev.cdrom.info = Can play audio:\t\t1\ndev.cdrom.info = Can write CD-R:\t\t0\ndev.cdrom.info = Can write CD-RW:\t0\ndev.cdrom.info = Can read DVD:\t\t1\ndev.cdrom.info = Can write DVD-R:\t0\ndev.cdrom.info = Can write DVD-RAM:\t0\ndev.cdrom.info = Can read MRW:\t\t1\ndev.cdrom.info = Can write MRW:\t\t1\ndev.cdrom.info = Can write RAM:\t\t1\ndev.cdrom.info = \ndev.cdrom.info = \ndev.cdrom.lock = 0\ndev.hpet.max-user-freq = 64\ndev.mac_hid.mouse_button2_keycode = 97\ndev.mac_hid.mouse_button3_keycode = 100\ndev.mac_hid.mouse_button_emulation = 0\ndev.parport.default.spintime = 500\ndev.parport.default.timeslice = 200\ndev.raid.speed_limit_max = 200000\ndev.raid.speed_limit_min = 1000\ndev.scsi.logging_level = 0\ndev.tty.ldisc_autoload = 1\nfs.aio-max-nr = 65536\nfs.aio-nr = 0\nfs.binfmt_misc.status = enabled\nfs.dentry-state = 29947\t9161\t45\t0\t4142\t0\nfs.dir-notify-enable = 1\nfs.epoll.max_user_watches = 815411\nfs.file-max = 397913\nfs.file-nr = 9280\t0\t397913\nfs.inode-nr = 29646\t4055\nfs.inode-state = 29646\t4055\t0\t0\t0\t0\t0\nfs.inotify.max_queued_events = 16384\nfs.inotify.max_user_instances = 128\nfs.inotify.max_user_watches = 8192\nfs.lease-break-time = 45\nfs.leases-enable = 1\nfs.mount-max = 100000\nfs.mqueue.msg_default = 10\nfs.mqueue.msg_max = 10\nfs.mqueue.msgsize_default = 8192\nfs.mqueue.msgsize_max = 8192\nfs.mqueue.queues_max = 256\nfs.nr_open = 1048576\nfs.overflowgid = 65534\nfs.overflowuid = 65534\nfs.pipe-max-size = 1048576\nfs.pipe-user-pages-hard = 0\nfs.pipe-user-pages-soft = 16384\nsysctl: permission denied on key "fs.protected_fifos"\nsysctl: permission denied on key "fs.protected_hardlinks"\nsysctl: permission denied on key "fs.protected_regular"\nsysctl: permission denied on key "fs.protected_symlinks"\nfs.quota.allocated_dquots = 0\nfs.quota.cache_hits = 0\nfs.quota.drops = 0\nfs.quota.free_dquots = 0\nfs.quota.lookups = 0\nfs.quota.reads = 0\nfs.quota.syncs = 80\nfs.quota.writes = 0\nfs.suid_dumpable = 2\nfs.xfs.error_level = 3\nfs.xfs.filestream_centisecs = 3000\nfs.xfs.inherit_noatime = 1\nfs.xfs.inherit_nodefrag = 1\nfs.xfs.inherit_nodump = 1\nfs.xfs.inherit_nosymlinks = 0\nfs.xfs.inherit_sync = 1\nfs.xfs.irix_sgid_inherit = 0\nfs.xfs.irix_symlink_mode = 0\nfs.xfs.panic_mask = 0\nfs.xfs.rotorstep = 1\nfs.xfs.speculative_cow_prealloc_lifetime = 1800\nfs.xfs.speculative_prealloc_lifetime = 300\nfs.xfs.stats_clear = 0\nfs.xfs.xfssyncd_centisecs = 3000\nkernel.acct = 4\t2\t30\nkernel.acpi_video_flags = 0\nkernel.auto_msgmni = 0\nkernel.bootloader_type = 114\nkernel.bootloader_version = 2\nkernel.bpf_stats_enabled = 0\nsysctl: permission denied on key "kernel.cad_pid"\nkernel.cap_last_cap = 37\nkernel.core_pattern = |/usr/share/apport/apport %p %s %c %d %P\nkernel.core_pipe_limit = 0\nkernel.core_uses_pid = 0\nkernel.ctrl-alt-del = 0\nkernel.dmesg_restrict = 0\nkernel.domainname = (none)\nkernel.firmware_config.force_sysfs_fallback = 0\nkernel.firmware_config.ignore_sysfs_fallback = 0\nkernel.ftrace_dump_on_oops = 0\nkernel.ftrace_enabled = 1\nkernel.hardlockup_all_cpu_backtrace = 0\nkernel.hardlockup_panic = 0\nkernel.hostname = hanayozz\nkernel.hotplug = \nkernel.hung_task_check_count = 4194304\nkernel.hung_task_check_interval_secs = 0\nkernel.hung_task_panic = 0\nkernel.hung_task_timeout_secs = 120\nkernel.hung_task_warnings = 10\nkernel.io_delay_type = 1\nkernel.kexec_load_disabled = 0\nkernel.keys.gc_delay = 300\nkernel.keys.maxbytes = 20000\nkernel.keys.maxkeys = 200\nkernel.keys.persistent_keyring_expiry = 259200\nkernel.keys.root_maxbytes = 25000000\nkernel.keys.root_maxkeys = 1000000\nkernel.kptr_restrict = 1\nkernel.max_lock_depth = 1024\nkernel.modprobe = /sbin/modprobe\nkernel.modules_disabled = 0\nkernel.msg_next_id = -1\nkernel.msgmax = 8192\nkernel.msgmnb = 16384\nkernel.msgmni = 32000\nkernel.ngroups_max = 65536\nkernel.nmi_watchdog = 0\nkernel.ns_last_pid = 7388\nkernel.numa_balancing = 0\nkernel.numa_balancing_scan_delay_ms = 1000\nkernel.numa_balancing_scan_period_max_ms = 60000\nkernel.numa_balancing_scan_period_min_ms = 1000\nkernel.numa_balancing_scan_size_mb = 256\nkernel.osrelease = 5.3.0-40-generic\nkernel.ostype = Linux\nkernel.overflowgid = 65534\nkernel.overflowuid = 65534\nkernel.panic = 0\nkernel.panic_on_io_nmi = 0\nkernel.panic_on_oops = 0\nkernel.panic_on_rcu_stall = 0\nkernel.panic_on_unrecovered_nmi = 0\nkernel.panic_on_warn = 0\nkernel.panic_print = 0\nkernel.perf_cpu_time_max_percent = 25\nkernel.perf_event_max_contexts_per_stack = 8\nkernel.perf_event_max_sample_rate = 100000\nkernel.perf_event_max_stack = 127\nkernel.perf_event_mlock_kb = 516\nkernel.perf_event_paranoid = 3\nkernel.pid_max = 32768\nkernel.poweroff_cmd = /sbin/poweroff\nkernel.print-fatal-signals = 0\nkernel.printk = 4\t4\t1\t7\nkernel.printk_delay = 0\nkernel.printk_devkmsg = ratelimit\nkernel.printk_ratelimit = 5\nkernel.printk_ratelimit_burst = 10\nkernel.pty.max = 4096\nkernel.pty.nr = 1\nkernel.pty.reserve = 1024\nkernel.random.boot_id = 24e637c4-c64d-49ea-afda-3bb4649cf301\nkernel.random.entropy_avail = 3762\nkernel.random.poolsize = 4096\nkernel.random.read_wakeup_threshold = 64\nkernel.random.urandom_min_reseed_secs = 60\nkernel.random.uuid = bbe74170-390c-42df-a727-ad3afeb53590\nkernel.random.write_wakeup_threshold = 896\nkernel.randomize_va_space = 2\nkernel.real-root-dev = 0\nkernel.sched_autogroup_enabled = 1\nkernel.sched_cfs_bandwidth_slice_us = 5000\nkernel.sched_child_runs_first = 0\nkernel.sched_domain.cpu0.domain0.busy_factor = 32\nkernel.sched_domain.cpu0.domain0.cache_nice_tries = 1\nkernel.sched_domain.cpu0.domain0.flags = 4143\nkernel.sched_domain.cpu0.domain0.imbalance_pct = 125\nkernel.sched_domain.cpu0.domain0.max_interval = 4\nkernel.sched_domain.cpu0.domain0.max_newidle_lb_cost = 6324937\nkernel.sched_domain.cpu0.domain0.min_interval = 2\nkernel.sched_domain.cpu0.domain0.name = DIE\nkernel.sched_domain.cpu1.domain0.busy_factor = 32\nkernel.sched_domain.cpu1.domain0.cache_nice_tries = 1\nkernel.sched_domain.cpu1.domain0.flags = 4143\nkernel.sched_domain.cpu1.domain0.imbalance_pct = 125\nkernel.sched_domain.cpu1.domain0.max_interval = 4\nkernel.sched_domain.cpu1.domain0.max_newidle_lb_cost = 283074\nkernel.sched_domain.cpu1.domain0.min_interval = 2\nkernel.sched_domain.cpu1.domain0.name = DIE\nkernel.sched_latency_ns = 12000000\nkernel.sched_migration_cost_ns = 500000\nkernel.sched_min_granularity_ns = 1500000\nkernel.sched_nr_migrate = 32\nkernel.sched_rr_timeslice_ms = 100\nkernel.sched_rt_period_us = 1000000\nkernel.sched_rt_runtime_us = 950000\nkernel.sched_schedstats = 0\nkernel.sched_tunable_scaling = 1\nkernel.sched_util_clamp_max = 1024\nkernel.sched_util_clamp_min = 1024\nkernel.sched_wakeup_granularity_ns = 2000000\nkernel.seccomp.actions_avail = kill_process kill_thread trap errno user_notif trace log allow\nkernel.seccomp.actions_logged = kill_process kill_thread trap errno user_notif trace log\nkernel.sem = 32000\t1024000000\t500\t32000\nkernel.sem_next_id = -1\nkernel.sg-big-buff = 32768\nkernel.shm_next_id = -1\nkernel.shm_rmid_forced = 0\nkernel.shmall = 18446744073692774399\nkernel.shmmax = 18446744073692774399\nkernel.shmmni = 4096\nkernel.soft_watchdog = 1\nkernel.softlockup_all_cpu_backtrace = 0\nkernel.softlockup_panic = 0\nkernel.stack_tracer_enabled = 0\nkernel.sysctl_writes_strict = 1\nkernel.sysrq = 176\nkernel.tainted = 4096\nkernel.threads-max = 31105\nkernel.timer_migration = 1\nkernel.traceoff_on_warning = 0\nkernel.tracepoint_printk = 0\nkernel.unknown_nmi_panic = 0\nkernel.unprivileged_bpf_disabled = 0\nsysctl: permission denied on key "kernel.unprivileged_userns_apparmor_policy"\nkernel.unprivileged_userns_clone = 1\nsysctl: permission denied on key "kernel.usermodehelper.bset"\nsysctl: permission denied on key "kernel.usermodehelper.inheritable"\nkernel.version = #32~18.04.1-Ubuntu SMP Mon Feb 3 14:05:59 UTC 2020\nkernel.watchdog = 1\nkernel.watchdog_cpumask = 0-1\nkernel.watchdog_thresh = 10\nkernel.yama.ptrace_scope = 1\nnet.core.bpf_jit_enable = 1\nsysctl: permission denied on key "net.core.bpf_jit_harden"\nsysctl: permission denied on key "net.core.bpf_jit_kallsyms"\nsysctl: permission denied on key "net.core.bpf_jit_limit"\nnet.core.busy_poll = 0\nnet.core.busy_read = 0\nnet.core.default_qdisc = fq_codel\nnet.core.dev_weight = 64\nnet.core.dev_weight_rx_bias = 1\nnet.core.dev_weight_tx_bias = 1\nnet.core.devconf_inherit_init_net = 0\nnet.core.fb_tunnels_only_for_init_net = 0\nnet.core.flow_limit_cpu_bitmap = 0\nnet.core.flow_limit_table_len = 4096\nnet.core.high_order_alloc_disable = 0\nnet.core.max_skb_frags = 17\nnet.core.message_burst = 10\nnet.core.message_cost = 5\nnet.core.netdev_budget = 300\nnet.core.netdev_budget_usecs = 2000\nnet.core.netdev_max_backlog = 1000\nnet.core.netdev_rss_key = 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00\nnet.core.netdev_tstamp_prequeue = 1\nnet.core.optmem_max = 20480\nnet.core.rmem_default = 212992\nnet.core.rmem_max = 212992\nnet.core.rps_sock_flow_entries = 0\nnet.core.somaxconn = 128\nnet.core.tstamp_allow_data = 1\nnet.core.warnings = 0\nnet.core.wmem_default = 212992\nnet.core.wmem_max = 212992\nnet.core.xfrm_acq_expires = 30\nnet.core.xfrm_aevent_etime = 10\nnet.core.xfrm_aevent_rseqth = 2\nnet.core.xfrm_larval_drop = 1\nnet.ipv4.cipso_cache_bucket_size = 10\nnet.ipv4.cipso_cache_enable = 1\nnet.ipv4.cipso_rbm_optfmt = 0\nnet.ipv4.cipso_rbm_strictvalid = 1\nnet.ipv4.conf.all.accept_local = 0\nnet.ipv4.conf.all.accept_redirects = 1\nnet.ipv4.conf.all.accept_source_route = 0\nnet.ipv4.conf.all.arp_accept = 0\nnet.ipv4.conf.all.arp_announce = 0\nnet.ipv4.conf.all.arp_filter = 0\nnet.ipv4.conf.all.arp_ignore = 0\nnet.ipv4.conf.all.arp_notify = 0\nnet.ipv4.conf.all.bc_forwarding = 0\nnet.ipv4.conf.all.bootp_relay = 0\nnet.ipv4.conf.all.disable_policy = 0\nnet.ipv4.conf.all.disable_xfrm = 0\nnet.ipv4.conf.all.drop_gratuitous_arp = 0\nnet.ipv4.conf.all.drop_unicast_in_l2_multicast = 0\nnet.ipv4.conf.all.force_igmp_version = 0\nnet.ipv4.conf.all.forwarding = 0\nnet.ipv4.conf.all.igmpv2_unsolicited_report_interval = 10000\nnet.ipv4.conf.all.igmpv3_unsolicited_report_interval = 1000\nnet.ipv4.conf.all.ignore_routes_with_linkdown = 0\nnet.ipv4.conf.all.log_martians = 0\nnet.ipv4.conf.all.mc_forwarding = 0\nnet.ipv4.conf.all.medium_id = 0\nnet.ipv4.conf.all.promote_secondaries = 1\nnet.ipv4.conf.all.proxy_arp = 0\nnet.ipv4.conf.all.proxy_arp_pvlan = 0\nnet.ipv4.conf.all.route_localnet = 0\nnet.ipv4.conf.all.rp_filter = 1\nnet.ipv4.conf.all.secure_redirects = 1\nnet.ipv4.conf.all.send_redirects = 1\nnet.ipv4.conf.all.shared_media = 1\nnet.ipv4.conf.all.src_valid_mark = 0\nnet.ipv4.conf.all.tag = 0\nnet.ipv4.conf.default.accept_local = 0\nnet.ipv4.conf.default.accept_redirects = 1\nnet.ipv4.conf.default.accept_source_route = 1\nnet.ipv4.conf.default.arp_accept = 0\nnet.ipv4.conf.default.arp_announce = 0\nnet.ipv4.conf.default.arp_filter = 0\nnet.ipv4.conf.default.arp_ignore = 0\nnet.ipv4.conf.default.arp_notify = 0\nnet.ipv4.conf.default.bc_forwarding = 0\nnet.ipv4.conf.default.bootp_relay = 0\nnet.ipv4.conf.default.disable_policy = 0\nnet.ipv4.conf.default.disable_xfrm = 0\nnet.ipv4.conf.default.drop_gratuitous_arp = 0\nnet.ipv4.conf.default.drop_unicast_in_l2_multicast = 0\nnet.ipv4.conf.default.force_igmp_version = 0\nnet.ipv4.conf.default.forwarding = 0\nnet.ipv4.conf.default.igmpv2_unsolicited_report_interval = 10000\nnet.ipv4.conf.default.igmpv3_unsolicited_report_interval = 1000\nnet.ipv4.conf.default.ignore_routes_with_linkdown = 0\nnet.ipv4.conf.default.log_martians = 0\nnet.ipv4.conf.default.mc_forwarding = 0\nnet.ipv4.conf.default.medium_id = 0\nnet.ipv4.conf.default.promote_secondaries = 0\nnet.ipv4.conf.default.proxy_arp = 0\nnet.ipv4.conf.default.proxy_arp_pvlan = 0\nnet.ipv4.conf.default.route_localnet = 0\nnet.ipv4.conf.default.rp_filter = 1\nnet.ipv4.conf.default.secure_redirects = 1\nnet.ipv4.conf.default.send_redirects = 1\nnet.ipv4.conf.default.shared_media = 1\nnet.ipv4.conf.default.src_valid_mark = 0\nnet.ipv4.conf.default.tag = 0\nnet.ipv4.conf.enp0s3.accept_local = 0\nnet.ipv4.conf.enp0s3.accept_redirects = 1\nnet.ipv4.conf.enp0s3.accept_source_route = 1\nnet.ipv4.conf.enp0s3.arp_accept = 0\nnet.ipv4.conf.enp0s3.arp_announce = 0\nnet.ipv4.conf.enp0s3.arp_filter = 0\nnet.ipv4.conf.enp0s3.arp_ignore = 0\nnet.ipv4.conf.enp0s3.arp_notify = 0\nnet.ipv4.conf.enp0s3.bc_forwarding = 0\nnet.ipv4.conf.enp0s3.bootp_relay = 0\nnet.ipv4.conf.enp0s3.disable_policy = 0\nnet.ipv4.conf.enp0s3.disable_xfrm = 0\nnet.ipv4.conf.enp0s3.drop_gratuitous_arp = 0\nnet.ipv4.conf.enp0s3.drop_unicast_in_l2_multicast = 0\nnet.ipv4.conf.enp0s3.force_igmp_version = 0\nnet.ipv4.conf.enp0s3.forwarding = 0\nnet.ipv4.conf.enp0s3.igmpv2_unsolicited_report_interval = 10000\nnet.ipv4.conf.enp0s3.igmpv3_unsolicited_report_interval = 1000\nnet.ipv4.conf.enp0s3.ignore_routes_with_linkdown = 0\nnet.ipv4.conf.enp0s3.log_martians = 0\nnet.ipv4.conf.enp0s3.mc_forwarding = 0\nnet.ipv4.conf.enp0s3.medium_id = 0\nnet.ipv4.conf.enp0s3.promote_secondaries = 0\nnet.ipv4.conf.enp0s3.proxy_arp = 0\nnet.ipv4.conf.enp0s3.proxy_arp_pvlan = 0\nnet.ipv4.conf.enp0s3.route_localnet = 0\nnet.ipv4.conf.enp0s3.rp_filter = 2\nnet.ipv4.conf.enp0s3.secure_redirects = 1\nnet.ipv4.conf.enp0s3.send_redirects = 1\nnet.ipv4.conf.enp0s3.shared_media = 1\nnet.ipv4.conf.enp0s3.src_valid_mark = 0\nnet.ipv4.conf.enp0s3.tag = 0\nnet.ipv4.conf.lo.accept_local = 0\nnet.ipv4.conf.lo.accept_redirects = 1\nnet.ipv4.conf.lo.accept_source_route = 1\nnet.ipv4.conf.lo.arp_accept = 0\nnet.ipv4.conf.lo.arp_announce = 0\nnet.ipv4.conf.lo.arp_filter = 0\nnet.ipv4.conf.lo.arp_ignore = 0\nnet.ipv4.conf.lo.arp_notify = 0\nnet.ipv4.conf.lo.bc_forwarding = 0\nnet.ipv4.conf.lo.bootp_relay = 0\nnet.ipv4.conf.lo.disable_policy = 1\nnet.ipv4.conf.lo.disable_xfrm = 1\nnet.ipv4.conf.lo.drop_gratuitous_arp = 0\nnet.ipv4.conf.lo.drop_unicast_in_l2_multicast = 0\nnet.ipv4.conf.lo.force_igmp_version = 0\nnet.ipv4.conf.lo.forwarding = 0\nnet.ipv4.conf.lo.igmpv2_unsolicited_report_interval = 10000\nnet.ipv4.conf.lo.igmpv3_unsolicited_report_interval = 1000\nnet.ipv4.conf.lo.ignore_routes_with_linkdown = 0\nnet.ipv4.conf.lo.log_martians = 0\nnet.ipv4.conf.lo.mc_forwarding = 0\nnet.ipv4.conf.lo.medium_id = 0\nnet.ipv4.conf.lo.promote_secondaries = 0\nnet.ipv4.conf.lo.proxy_arp = 0\nnet.ipv4.conf.lo.proxy_arp_pvlan = 0\nnet.ipv4.conf.lo.route_localnet = 0\nnet.ipv4.conf.lo.rp_filter = 0\nnet.ipv4.conf.lo.secure_redirects = 1\nnet.ipv4.conf.lo.send_redirects = 1\nnet.ipv4.conf.lo.shared_media = 1\nnet.ipv4.conf.lo.src_valid_mark = 0\nnet.ipv4.conf.lo.tag = 0\nnet.ipv4.fib_multipath_hash_policy = 0\nnet.ipv4.fib_multipath_use_neigh = 0\nnet.ipv4.fib_sync_mem = 524288\nnet.ipv4.fwmark_reflect = 0\nnet.ipv4.icmp_echo_ignore_all = 0\nnet.ipv4.icmp_echo_ignore_broadcasts = 1\nnet.ipv4.icmp_errors_use_inbound_ifaddr = 0\nnet.ipv4.icmp_ignore_bogus_error_responses = 1\nnet.ipv4.icmp_msgs_burst = 50\nnet.ipv4.icmp_msgs_per_sec = 1000\nnet.ipv4.icmp_ratelimit = 1000\nnet.ipv4.icmp_ratemask = 6168\nnet.ipv4.igmp_link_local_mcast_reports = 1\nnet.ipv4.igmp_max_memberships = 20\nnet.ipv4.igmp_max_msf = 10\nnet.ipv4.igmp_qrv = 2\nnet.ipv4.inet_peer_maxttl = 600\nnet.ipv4.inet_peer_minttl = 120\nnet.ipv4.inet_peer_threshold = 65664\nnet.ipv4.ip_default_ttl = 64\nnet.ipv4.ip_dynaddr = 0\nnet.ipv4.ip_early_demux = 1\nnet.ipv4.ip_forward = 0\nnet.ipv4.ip_forward_update_priority = 1\nnet.ipv4.ip_forward_use_pmtu = 0\nnet.ipv4.ip_local_port_range = 32768\t60999\nnet.ipv4.ip_local_reserved_ports = \nnet.ipv4.ip_no_pmtu_disc = 0\nnet.ipv4.ip_nonlocal_bind = 0\nnet.ipv4.ip_unprivileged_port_start = 1024\nnet.ipv4.ipfrag_high_thresh = 4194304\nnet.ipv4.ipfrag_low_thresh = 3145728\nnet.ipv4.ipfrag_max_dist = 64\nnet.ipv4.ipfrag_secret_interval = 0\nnet.ipv4.ipfrag_time = 30\nnet.ipv4.neigh.default.anycast_delay = 100\nnet.ipv4.neigh.default.app_solicit = 0\nnet.ipv4.neigh.default.base_reachable_time_ms = 30000\nnet.ipv4.neigh.default.delay_first_probe_time = 5\nnet.ipv4.neigh.default.gc_interval = 30\nnet.ipv4.neigh.default.gc_stale_time = 60\nnet.ipv4.neigh.default.gc_thresh1 = 128\nnet.ipv4.neigh.default.gc_thresh2 = 512\nnet.ipv4.neigh.default.gc_thresh3 = 1024\nnet.ipv4.neigh.default.locktime = 100\nnet.ipv4.neigh.default.mcast_resolicit = 0\nnet.ipv4.neigh.default.mcast_solicit = 3\nnet.ipv4.neigh.default.proxy_delay = 80\nnet.ipv4.neigh.default.proxy_qlen = 64\nnet.ipv4.neigh.default.retrans_time_ms = 1000\nnet.ipv4.neigh.default.ucast_solicit = 3\nnet.ipv4.neigh.default.unres_qlen = 101\nnet.ipv4.neigh.default.unres_qlen_bytes = 212992\nnet.ipv4.neigh.enp0s3.anycast_delay = 100\nnet.ipv4.neigh.enp0s3.app_solicit = 0\nnet.ipv4.neigh.enp0s3.base_reachable_time_ms = 30000\nnet.ipv4.neigh.enp0s3.delay_first_probe_time = 5\nnet.ipv4.neigh.enp0s3.gc_stale_time = 60\nnet.ipv4.neigh.enp0s3.locktime = 100\nnet.ipv4.neigh.enp0s3.mcast_resolicit = 0\nnet.ipv4.neigh.enp0s3.mcast_solicit = 3\nnet.ipv4.neigh.enp0s3.proxy_delay = 80\nnet.ipv4.neigh.enp0s3.proxy_qlen = 64\nnet.ipv4.neigh.enp0s3.retrans_time_ms = 1000\nnet.ipv4.neigh.enp0s3.ucast_solicit = 3\nnet.ipv4.neigh.enp0s3.unres_qlen = 101\nnet.ipv4.neigh.enp0s3.unres_qlen_bytes = 212992\nnet.ipv4.neigh.lo.anycast_delay = 100\nnet.ipv4.neigh.lo.app_solicit = 0\nnet.ipv4.neigh.lo.base_reachable_time_ms = 30000\nnet.ipv4.neigh.lo.delay_first_probe_time = 5\nnet.ipv4.neigh.lo.gc_stale_time = 60\nnet.ipv4.neigh.lo.locktime = 100\nnet.ipv4.neigh.lo.mcast_resolicit = 0\nnet.ipv4.neigh.lo.mcast_solicit = 3\nnet.ipv4.neigh.lo.proxy_delay = 80\nnet.ipv4.neigh.lo.proxy_qlen = 64\nnet.ipv4.neigh.lo.retrans_time_ms = 1000\nnet.ipv4.neigh.lo.ucast_solicit = 3\nnet.ipv4.neigh.lo.unres_qlen = 101\nnet.ipv4.neigh.lo.unres_qlen_bytes = 212992\nnet.ipv4.ping_group_range = 1\t0\nnet.ipv4.raw_l3mdev_accept = 1\nnet.ipv4.route.error_burst = 1250\nnet.ipv4.route.error_cost = 250\nnet.ipv4.route.gc_elasticity = 8\nnet.ipv4.route.gc_interval = 60\nnet.ipv4.route.gc_min_interval = 0\nnet.ipv4.route.gc_min_interval_ms = 500\nnet.ipv4.route.gc_thresh = -1\nnet.ipv4.route.gc_timeout = 300\nnet.ipv4.route.max_size = 2147483647\nnet.ipv4.route.min_adv_mss = 256\nnet.ipv4.route.min_pmtu = 552\nnet.ipv4.route.mtu_expires = 600\nnet.ipv4.route.redirect_load = 5\nnet.ipv4.route.redirect_number = 9\nnet.ipv4.route.redirect_silence = 5120\nnet.ipv4.tcp_abort_on_overflow = 0\nnet.ipv4.tcp_adv_win_scale = 1\nnet.ipv4.tcp_allowed_congestion_control = reno cubic\nnet.ipv4.tcp_app_win = 31\nnet.ipv4.tcp_autocorking = 1\nnet.ipv4.tcp_available_congestion_control = reno cubic\nnet.ipv4.tcp_available_ulp = \nnet.ipv4.tcp_base_mss = 1024\nnet.ipv4.tcp_challenge_ack_limit = 1000\nnet.ipv4.tcp_comp_sack_delay_ns = 1000000\nnet.ipv4.tcp_comp_sack_nr = 44\nnet.ipv4.tcp_congestion_control = cubic\nnet.ipv4.tcp_dsack = 1\nnet.ipv4.tcp_early_demux = 1\nnet.ipv4.tcp_early_retrans = 3\nnet.ipv4.tcp_ecn = 2\nnet.ipv4.tcp_ecn_fallback = 1\nnet.ipv4.tcp_fack = 0\nnet.ipv4.tcp_fastopen = 1\nnet.ipv4.tcp_fastopen_blackhole_timeout_sec = 3600\nsysctl: permission denied on key "net.ipv4.tcp_fastopen_key"\nnet.ipv4.tcp_fin_timeout = 60\nnet.ipv4.tcp_frto = 2\nnet.ipv4.tcp_fwmark_accept = 0\nnet.ipv4.tcp_invalid_ratelimit = 500\nnet.ipv4.tcp_keepalive_intvl = 75\nnet.ipv4.tcp_keepalive_probes = 9\nnet.ipv4.tcp_keepalive_time = 7200\nnet.ipv4.tcp_l3mdev_accept = 0\nnet.ipv4.tcp_limit_output_bytes = 1048576\nnet.ipv4.tcp_low_latency = 0\nnet.ipv4.tcp_max_orphans = 16384\nnet.ipv4.tcp_max_reordering = 300\nnet.ipv4.tcp_max_syn_backlog = 128\nnet.ipv4.tcp_max_tw_buckets = 16384\nnet.ipv4.tcp_mem = 45468\t60627\t90936\nnet.ipv4.tcp_min_rtt_wlen = 300\nnet.ipv4.tcp_min_snd_mss = 48\nnet.ipv4.tcp_min_tso_segs = 2\nnet.ipv4.tcp_moderate_rcvbuf = 1\nnet.ipv4.tcp_mtu_probing = 0\nnet.ipv4.tcp_no_metrics_save = 0\nnet.ipv4.tcp_notsent_lowat = 4294967295\nnet.ipv4.tcp_orphan_retries = 0\nnet.ipv4.tcp_pacing_ca_ratio = 120\nnet.ipv4.tcp_pacing_ss_ratio = 200\nnet.ipv4.tcp_probe_interval = 600\nnet.ipv4.tcp_probe_threshold = 8\nnet.ipv4.tcp_recovery = 1\nnet.ipv4.tcp_reordering = 3\nnet.ipv4.tcp_retrans_collapse = 1\nnet.ipv4.tcp_retries1 = 3\nnet.ipv4.tcp_retries2 = 15\nnet.ipv4.tcp_rfc1337 = 0\nnet.ipv4.tcp_rmem = 4096\t131072\t6291456\nnet.ipv4.tcp_rx_skb_cache = 0\nnet.ipv4.tcp_sack = 1\nnet.ipv4.tcp_slow_start_after_idle = 1\nnet.ipv4.tcp_stdurg = 0\nnet.ipv4.tcp_syn_retries = 6\nnet.ipv4.tcp_synack_retries = 5\nnet.ipv4.tcp_syncookies = 1\nnet.ipv4.tcp_thin_linear_timeouts = 0\nnet.ipv4.tcp_timestamps = 1\nnet.ipv4.tcp_tso_win_divisor = 3\nnet.ipv4.tcp_tw_reuse = 2\nnet.ipv4.tcp_tx_skb_cache = 0\nnet.ipv4.tcp_window_scaling = 1\nnet.ipv4.tcp_wmem = 4096\t16384\t4194304\nnet.ipv4.tcp_workaround_signed_windows = 0\nnet.ipv4.udp_early_demux = 1\nnet.ipv4.udp_l3mdev_accept = 0\nnet.ipv4.udp_mem = 90939\t121254\t181878\nnet.ipv4.udp_rmem_min = 4096\nnet.ipv4.udp_wmem_min = 4096\nnet.ipv4.xfrm4_gc_thresh = 32768\nnet.ipv6.anycast_src_echo_reply = 0\nnet.ipv6.auto_flowlabels = 1\nnet.ipv6.bindv6only = 0\nnet.ipv6.calipso_cache_bucket_size = 10\nnet.ipv6.calipso_cache_enable = 1\nnet.ipv6.conf.all.accept_dad = 0\nnet.ipv6.conf.all.accept_ra = 1\nnet.ipv6.conf.all.accept_ra_defrtr = 1\nnet.ipv6.conf.all.accept_ra_from_local = 0\nnet.ipv6.conf.all.accept_ra_min_hop_limit = 1\nnet.ipv6.conf.all.accept_ra_mtu = 1\nnet.ipv6.conf.all.accept_ra_pinfo = 1\nnet.ipv6.conf.all.accept_ra_rt_info_max_plen = 0\nnet.ipv6.conf.all.accept_ra_rt_info_min_plen = 0\nnet.ipv6.conf.all.accept_ra_rtr_pref = 1\nnet.ipv6.conf.all.accept_redirects = 1\nnet.ipv6.conf.all.accept_source_route = 0\nnet.ipv6.conf.all.addr_gen_mode = 0\nnet.ipv6.conf.all.autoconf = 1\nnet.ipv6.conf.all.dad_transmits = 1\nnet.ipv6.conf.all.disable_ipv6 = 0\nnet.ipv6.conf.all.disable_policy = 0\nnet.ipv6.conf.all.drop_unicast_in_l2_multicast = 0\nnet.ipv6.conf.all.drop_unsolicited_na = 0\nnet.ipv6.conf.all.enhanced_dad = 1\nnet.ipv6.conf.all.force_mld_version = 0\nnet.ipv6.conf.all.force_tllao = 0\nnet.ipv6.conf.all.forwarding = 0\nnet.ipv6.conf.all.hop_limit = 64\nnet.ipv6.conf.all.ignore_routes_with_linkdown = 0\nnet.ipv6.conf.all.keep_addr_on_down = 0\nnet.ipv6.conf.all.max_addresses = 16\nnet.ipv6.conf.all.max_desync_factor = 600\nnet.ipv6.conf.all.mc_forwarding = 0\nnet.ipv6.conf.all.mldv1_unsolicited_report_interval = 10000\nnet.ipv6.conf.all.mldv2_unsolicited_report_interval = 1000\nnet.ipv6.conf.all.mtu = 1280\nnet.ipv6.conf.all.ndisc_notify = 0\nnet.ipv6.conf.all.ndisc_tclass = 0\nnet.ipv6.conf.all.proxy_ndp = 0\nnet.ipv6.conf.all.regen_max_retry = 3\nnet.ipv6.conf.all.router_probe_interval = 60\nnet.ipv6.conf.all.router_solicitation_delay = 1\nnet.ipv6.conf.all.router_solicitation_interval = 4\nnet.ipv6.conf.all.router_solicitation_max_interval = 3600\nnet.ipv6.conf.all.router_solicitations = -1\nnet.ipv6.conf.all.seg6_enabled = 0\nnet.ipv6.conf.all.seg6_require_hmac = 0\nsysctl: permission denied on key "net.ipv6.conf.all.stable_secret"\nnet.ipv6.conf.all.suppress_frag_ndisc = 1\nnet.ipv6.conf.all.temp_prefered_lft = 86400\nnet.ipv6.conf.all.temp_valid_lft = 604800\nnet.ipv6.conf.all.use_oif_addrs_only = 0\nnet.ipv6.conf.all.use_tempaddr = 2\nnet.ipv6.conf.default.accept_dad = 1\nnet.ipv6.conf.default.accept_ra = 1\nnet.ipv6.conf.default.accept_ra_defrtr = 1\nnet.ipv6.conf.default.accept_ra_from_local = 0\nnet.ipv6.conf.default.accept_ra_min_hop_limit = 1\nnet.ipv6.conf.default.accept_ra_mtu = 1\nnet.ipv6.conf.default.accept_ra_pinfo = 1\nnet.ipv6.conf.default.accept_ra_rt_info_max_plen = 0\nnet.ipv6.conf.default.accept_ra_rt_info_min_plen = 0\nnet.ipv6.conf.default.accept_ra_rtr_pref = 1\nnet.ipv6.conf.default.accept_redirects = 1\nnet.ipv6.conf.default.accept_source_route = 0\nnet.ipv6.conf.default.addr_gen_mode = 0\nnet.ipv6.conf.default.autoconf = 1\nnet.ipv6.conf.default.dad_transmits = 1\nnet.ipv6.conf.default.disable_ipv6 = 0\nnet.ipv6.conf.default.disable_policy = 0\nnet.ipv6.conf.default.drop_unicast_in_l2_multicast = 0\nnet.ipv6.conf.default.drop_unsolicited_na = 0\nnet.ipv6.conf.default.enhanced_dad = 1\nnet.ipv6.conf.default.force_mld_version = 0\nnet.ipv6.conf.default.force_tllao = 0\nnet.ipv6.conf.default.forwarding = 0\nnet.ipv6.conf.default.hop_limit = 64\nnet.ipv6.conf.default.ignore_routes_with_linkdown = 0\nnet.ipv6.conf.default.keep_addr_on_down = 0\nnet.ipv6.conf.default.max_addresses = 16\nnet.ipv6.conf.default.max_desync_factor = 600\nnet.ipv6.conf.default.mc_forwarding = 0\nnet.ipv6.conf.default.mldv1_unsolicited_report_interval = 10000\nnet.ipv6.conf.default.mldv2_unsolicited_report_interval = 1000\nnet.ipv6.conf.default.mtu = 1280\nnet.ipv6.conf.default.ndisc_notify = 0\nnet.ipv6.conf.default.ndisc_tclass = 0\nnet.ipv6.conf.default.proxy_ndp = 0\nnet.ipv6.conf.default.regen_max_retry = 3\nnet.ipv6.conf.default.router_probe_interval = 60\nnet.ipv6.conf.default.router_solicitation_delay = 1\nnet.ipv6.conf.default.router_solicitation_interval = 4\nnet.ipv6.conf.default.router_solicitation_max_interval = 3600\nnet.ipv6.conf.default.router_solicitations = -1\nnet.ipv6.conf.default.seg6_enabled = 0\nnet.ipv6.conf.default.seg6_require_hmac = 0\nsysctl: permission denied on key "net.ipv6.conf.default.stable_secret"\nnet.ipv6.conf.default.suppress_frag_ndisc = 1\nnet.ipv6.conf.default.temp_prefered_lft = 86400\nnet.ipv6.conf.default.temp_valid_lft = 604800\nnet.ipv6.conf.default.use_oif_addrs_only = 0\nnet.ipv6.conf.default.use_tempaddr = 2\nnet.ipv6.conf.enp0s3.accept_dad = 1\nnet.ipv6.conf.enp0s3.accept_ra = 1\nnet.ipv6.conf.enp0s3.accept_ra_defrtr = 0\nnet.ipv6.conf.enp0s3.accept_ra_from_local = 0\nnet.ipv6.conf.enp0s3.accept_ra_min_hop_limit = 1\nnet.ipv6.conf.enp0s3.accept_ra_mtu = 1\nnet.ipv6.conf.enp0s3.accept_ra_pinfo = 0\nnet.ipv6.conf.enp0s3.accept_ra_rt_info_max_plen = 0\nnet.ipv6.conf.enp0s3.accept_ra_rt_info_min_plen = 0\nnet.ipv6.conf.enp0s3.accept_ra_rtr_pref = 0\nnet.ipv6.conf.enp0s3.accept_redirects = 1\nnet.ipv6.conf.enp0s3.accept_source_route = 0\nnet.ipv6.conf.enp0s3.addr_gen_mode = 1\nnet.ipv6.conf.enp0s3.autoconf = 1\nnet.ipv6.conf.enp0s3.dad_transmits = 1\nnet.ipv6.conf.enp0s3.disable_ipv6 = 0\nnet.ipv6.conf.enp0s3.disable_policy = 0\nnet.ipv6.conf.enp0s3.drop_unicast_in_l2_multicast = 0\nnet.ipv6.conf.enp0s3.drop_unsolicited_na = 0\nnet.ipv6.conf.enp0s3.enhanced_dad = 1\nnet.ipv6.conf.enp0s3.force_mld_version = 0\nnet.ipv6.conf.enp0s3.force_tllao = 0\nnet.ipv6.conf.enp0s3.forwarding = 0\nnet.ipv6.conf.enp0s3.hop_limit = 64\nnet.ipv6.conf.enp0s3.ignore_routes_with_linkdown = 0\nnet.ipv6.conf.enp0s3.keep_addr_on_down = 0\nnet.ipv6.conf.enp0s3.max_addresses = 16\nnet.ipv6.conf.enp0s3.max_desync_factor = 600\nnet.ipv6.conf.enp0s3.mc_forwarding = 0\nnet.ipv6.conf.enp0s3.mldv1_unsolicited_report_interval = 10000\nnet.ipv6.conf.enp0s3.mldv2_unsolicited_report_interval = 1000\nnet.ipv6.conf.enp0s3.mtu = 1500\nnet.ipv6.conf.enp0s3.ndisc_notify = 0\nnet.ipv6.conf.enp0s3.ndisc_tclass = 0\nnet.ipv6.conf.enp0s3.proxy_ndp = 0\nnet.ipv6.conf.enp0s3.regen_max_retry = 3\nnet.ipv6.conf.enp0s3.router_probe_interval = 60\nnet.ipv6.conf.enp0s3.router_solicitation_delay = 1\nnet.ipv6.conf.enp0s3.router_solicitation_interval = 4\nnet.ipv6.conf.enp0s3.router_solicitation_max_interval = 3600\nnet.ipv6.conf.enp0s3.router_solicitations = -1\nnet.ipv6.conf.enp0s3.seg6_enabled = 0\nnet.ipv6.conf.enp0s3.seg6_require_hmac = 0\nsysctl: permission denied on key "net.ipv6.conf.enp0s3.stable_secret"\nnet.ipv6.conf.enp0s3.suppress_frag_ndisc = 1\nnet.ipv6.conf.enp0s3.temp_prefered_lft = 86400\nnet.ipv6.conf.enp0s3.temp_valid_lft = 604800\nnet.ipv6.conf.enp0s3.use_oif_addrs_only = 0\nnet.ipv6.conf.enp0s3.use_tempaddr = 2\nnet.ipv6.conf.lo.accept_dad = -1\nnet.ipv6.conf.lo.accept_ra = 1\nnet.ipv6.conf.lo.accept_ra_defrtr = 1\nnet.ipv6.conf.lo.accept_ra_from_local = 0\nnet.ipv6.conf.lo.accept_ra_min_hop_limit = 1\nnet.ipv6.conf.lo.accept_ra_mtu = 1\nnet.ipv6.conf.lo.accept_ra_pinfo = 1\nnet.ipv6.conf.lo.accept_ra_rt_info_max_plen = 0\nnet.ipv6.conf.lo.accept_ra_rt_info_min_plen = 0\nnet.ipv6.conf.lo.accept_ra_rtr_pref = 1\nnet.ipv6.conf.lo.accept_redirects = 1\nnet.ipv6.conf.lo.accept_source_route = 0\nnet.ipv6.conf.lo.addr_gen_mode = 0\nnet.ipv6.conf.lo.autoconf = 1\nnet.ipv6.conf.lo.dad_transmits = 1\nnet.ipv6.conf.lo.disable_ipv6 = 0\nnet.ipv6.conf.lo.disable_policy = 0\nnet.ipv6.conf.lo.drop_unicast_in_l2_multicast = 0\nnet.ipv6.conf.lo.drop_unsolicited_na = 0\nnet.ipv6.conf.lo.enhanced_dad = 1\nnet.ipv6.conf.lo.force_mld_version = 0\nnet.ipv6.conf.lo.force_tllao = 0\nnet.ipv6.conf.lo.forwarding = 0\nnet.ipv6.conf.lo.hop_limit = 64\nnet.ipv6.conf.lo.ignore_routes_with_linkdown = 0\nnet.ipv6.conf.lo.keep_addr_on_down = 0\nnet.ipv6.conf.lo.max_addresses = 16\nnet.ipv6.conf.lo.max_desync_factor = 600\nnet.ipv6.conf.lo.mc_forwarding = 0\nnet.ipv6.conf.lo.mldv1_unsolicited_report_interval = 10000\nnet.ipv6.conf.lo.mldv2_unsolicited_report_interval = 1000\nnet.ipv6.conf.lo.mtu = 65536\nnet.ipv6.conf.lo.ndisc_notify = 0\nnet.ipv6.conf.lo.ndisc_tclass = 0\nnet.ipv6.conf.lo.proxy_ndp = 0\nnet.ipv6.conf.lo.regen_max_retry = 3\nnet.ipv6.conf.lo.router_probe_interval = 60\nnet.ipv6.conf.lo.router_solicitation_delay = 1\nnet.ipv6.conf.lo.router_solicitation_interval = 4\nnet.ipv6.conf.lo.router_solicitation_max_interval = 3600\nnet.ipv6.conf.lo.router_solicitations = -1\nnet.ipv6.conf.lo.seg6_enabled = 0\nnet.ipv6.conf.lo.seg6_require_hmac = 0\nsysctl: permission denied on key "net.ipv6.conf.lo.stable_secret"\nnet.ipv6.conf.lo.suppress_frag_ndisc = 1\nnet.ipv6.conf.lo.temp_prefered_lft = 86400\nnet.ipv6.conf.lo.temp_valid_lft = 604800\nnet.ipv6.conf.lo.use_oif_addrs_only = 0\nnet.ipv6.conf.lo.use_tempaddr = -1\nnet.ipv6.fib_multipath_hash_policy = 0\nnet.ipv6.flowlabel_consistency = 1\nnet.ipv6.flowlabel_reflect = 0\nnet.ipv6.flowlabel_state_ranges = 0\nnet.ipv6.fwmark_reflect = 0\nnet.ipv6.icmp.echo_ignore_all = 0\nnet.ipv6.icmp.echo_ignore_anycast = 0\nnet.ipv6.icmp.echo_ignore_multicast = 0\nnet.ipv6.icmp.ratelimit = 1000\nnet.ipv6.icmp.ratemask = 0-1,3-127\nnet.ipv6.idgen_delay = 1\nnet.ipv6.idgen_retries = 3\nnet.ipv6.ip6frag_high_thresh = 4194304\nnet.ipv6.ip6frag_low_thresh = 3145728\nnet.ipv6.ip6frag_secret_interval = 0\nnet.ipv6.ip6frag_time = 60\nnet.ipv6.ip_nonlocal_bind = 0\nnet.ipv6.max_dst_opts_length = 2147483647\nnet.ipv6.max_dst_opts_number = 8\nnet.ipv6.max_hbh_length = 2147483647\nnet.ipv6.max_hbh_opts_number = 8\nnet.ipv6.mld_max_msf = 64\nnet.ipv6.mld_qrv = 2\nnet.ipv6.neigh.default.anycast_delay = 100\nnet.ipv6.neigh.default.app_solicit = 0\nnet.ipv6.neigh.default.base_reachable_time_ms = 30000\nnet.ipv6.neigh.default.delay_first_probe_time = 5\nnet.ipv6.neigh.default.gc_interval = 30\nnet.ipv6.neigh.default.gc_stale_time = 60\nnet.ipv6.neigh.default.gc_thresh1 = 128\nnet.ipv6.neigh.default.gc_thresh2 = 512\nnet.ipv6.neigh.default.gc_thresh3 = 1024\nnet.ipv6.neigh.default.locktime = 0\nnet.ipv6.neigh.default.mcast_resolicit = 0\nnet.ipv6.neigh.default.mcast_solicit = 3\nnet.ipv6.neigh.default.proxy_delay = 80\nnet.ipv6.neigh.default.proxy_qlen = 64\nnet.ipv6.neigh.default.retrans_time_ms = 1000\nnet.ipv6.neigh.default.ucast_solicit = 3\nnet.ipv6.neigh.default.unres_qlen = 101\nnet.ipv6.neigh.default.unres_qlen_bytes = 212992\nnet.ipv6.neigh.enp0s3.anycast_delay = 100\nnet.ipv6.neigh.enp0s3.app_solicit = 0\nnet.ipv6.neigh.enp0s3.base_reachable_time_ms = 30000\nnet.ipv6.neigh.enp0s3.delay_first_probe_time = 5\nnet.ipv6.neigh.enp0s3.gc_stale_time = 60\nnet.ipv6.neigh.enp0s3.locktime = 0\nnet.ipv6.neigh.enp0s3.mcast_resolicit = 0\nnet.ipv6.neigh.enp0s3.mcast_solicit = 3\nnet.ipv6.neigh.enp0s3.proxy_delay = 80\nnet.ipv6.neigh.enp0s3.proxy_qlen = 64\nnet.ipv6.neigh.enp0s3.retrans_time_ms = 1000\nnet.ipv6.neigh.enp0s3.ucast_solicit = 3\nnet.ipv6.neigh.enp0s3.unres_qlen = 101\nnet.ipv6.neigh.enp0s3.unres_qlen_bytes = 212992\nnet.ipv6.neigh.lo.anycast_delay = 100\nnet.ipv6.neigh.lo.app_solicit = 0\nnet.ipv6.neigh.lo.base_reachable_time_ms = 30000\nnet.ipv6.neigh.lo.delay_first_probe_time = 5\nnet.ipv6.neigh.lo.gc_stale_time = 60\nnet.ipv6.neigh.lo.locktime = 0\nnet.ipv6.neigh.lo.mcast_resolicit = 0\nnet.ipv6.neigh.lo.mcast_solicit = 3\nnet.ipv6.neigh.lo.proxy_delay = 80\nnet.ipv6.neigh.lo.proxy_qlen = 64\nnet.ipv6.neigh.lo.retrans_time_ms = 1000\nnet.ipv6.neigh.lo.ucast_solicit = 3\nnet.ipv6.neigh.lo.unres_qlen = 101\nnet.ipv6.neigh.lo.unres_qlen_bytes = 212992\nnet.ipv6.route.gc_elasticity = 9\nnet.ipv6.route.gc_interval = 30\nnet.ipv6.route.gc_min_interval = 0\nnet.ipv6.route.gc_min_interval_ms = 500\nnet.ipv6.route.gc_thresh = 1024\nnet.ipv6.route.gc_timeout = 60\nnet.ipv6.route.max_size = 4096\nnet.ipv6.route.min_adv_mss = 1220\nnet.ipv6.route.mtu_expires = 600\nnet.ipv6.route.skip_notify_on_dev_down = 0\nnet.ipv6.seg6_flowlabel = 0\nnet.ipv6.xfrm6_gc_thresh = 32768\nnet.netfilter.nf_log.0 = NONE\nnet.netfilter.nf_log.1 = NONE\nnet.netfilter.nf_log.10 = NONE\nnet.netfilter.nf_log.11 = NONE\nnet.netfilter.nf_log.12 = NONE\nnet.netfilter.nf_log.2 = NONE\nnet.netfilter.nf_log.3 = NONE\nnet.netfilter.nf_log.4 = NONE\nnet.netfilter.nf_log.5 = NONE\nnet.netfilter.nf_log.6 = NONE\nnet.netfilter.nf_log.7 = NONE\nnet.netfilter.nf_log.8 = NONE\nnet.netfilter.nf_log.9 = NONE\nnet.netfilter.nf_log_all_netns = 0\nnet.unix.max_dgram_qlen = 512\nuser.max_cgroup_namespaces = 15552\nuser.max_inotify_instances = 128\nuser.max_inotify_watches = 8192\nuser.max_ipc_namespaces = 15552\nuser.max_mnt_namespaces = 15552\nuser.max_net_namespaces = 15552\nuser.max_pid_namespaces = 15552\nuser.max_user_namespaces = 15552\nuser.max_uts_namespaces = 15552\nvm.admin_reserve_kbytes = 8192\nvm.block_dump = 0\nvm.compact_unevictable_allowed = 1\nvm.dirty_background_bytes = 0\nvm.dirty_background_ratio = 10\nvm.dirty_bytes = 0\nvm.dirty_expire_centisecs = 3000\nvm.dirty_ratio = 20\nvm.dirty_writeback_centisecs = 500\nvm.dirtytime_expire_seconds = 43200\nvm.extfrag_threshold = 500\nvm.hugetlb_shm_group = 0\nvm.laptop_mode = 0\nvm.legacy_va_layout = 0\nvm.lowmem_reserve_ratio = 256\t256\t32\t0\t0\nvm.max_map_count = 65530\nvm.memory_failure_early_kill = 0\nvm.memory_failure_recovery = 1\nvm.min_free_kbytes = 67584\nvm.min_slab_ratio = 5\nvm.min_unmapped_ratio = 1\nvm.mmap_min_addr = 65536\nsysctl: permission denied on key "vm.mmap_rnd_bits"\nsysctl: permission denied on key "vm.mmap_rnd_compat_bits"\nvm.nr_hugepages = 0\nvm.nr_hugepages_mempolicy = 0\nvm.nr_overcommit_hugepages = 0\nvm.numa_stat = 1\nvm.numa_zonelist_order = Node\nvm.oom_dump_tasks = 1\nvm.oom_kill_allocating_task = 0\nvm.overcommit_kbytes = 0\nvm.overcommit_memory = 0\nvm.overcommit_ratio = 50\nvm.page-cluster = 3\nvm.panic_on_oom = 0\nvm.percpu_pagelist_fraction = 0\nvm.stat_interval = 1\nsysctl: permission denied on key "vm.stat_refresh"\nvm.swappiness = 60\nvm.unprivileged_userfaultfd = 1\nvm.user_reserve_kbytes = 124299\nvm.vfs_cache_pressure = 100\nvm.watermark_boost_factor = 15000\nvm.watermark_scale_factor = 10\nvm.zone_reclaim_mode = 0\n", + "cpuinfo": "processor\t: 0\nvendor_id\t: GenuineIntel\ncpu family\t: 6\nmodel\t\t: 142\nmodel name\t: Intel(R) Core(TM) i5-7300U CPU @ 2.60GHz\nstepping\t: 9\ncpu MHz\t\t: 2712.000\ncache size\t: 3072 KB\nphysical id\t: 0\nsiblings\t: 2\ncore id\t\t: 0\ncpu cores\t: 2\napicid\t\t: 0\ninitial apicid\t: 0\nfpu\t\t: yes\nfpu_exception\t: yes\ncpuid level\t: 22\nwp\t\t: yes\nflags\t\t: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx rdtscp lm constant_tsc rep_good nopl xtopology nonstop_tsc cpuid tsc_known_freq pni pclmulqdq ssse3 cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single pti fsgsbase avx2 invpcid rdseed clflushopt flush_l1d\nbugs\t\t: cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit\nbogomips\t: 5424.00\nclflush size\t: 64\ncache_alignment\t: 64\naddress sizes\t: 39 bits physical, 48 bits virtual\npower management:\n\nprocessor\t: 1\nvendor_id\t: GenuineIntel\ncpu family\t: 6\nmodel\t\t: 142\nmodel name\t: Intel(R) Core(TM) i5-7300U CPU @ 2.60GHz\nstepping\t: 9\ncpu MHz\t\t: 2712.000\ncache size\t: 3072 KB\nphysical id\t: 0\nsiblings\t: 2\ncore id\t\t: 1\ncpu cores\t: 2\napicid\t\t: 1\ninitial apicid\t: 1\nfpu\t\t: yes\nfpu_exception\t: yes\ncpuid level\t: 22\nwp\t\t: yes\nflags\t\t: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx rdtscp lm constant_tsc rep_good nopl xtopology nonstop_tsc cpuid tsc_known_freq pni pclmulqdq ssse3 cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single pti fsgsbase avx2 invpcid rdseed clflushopt flush_l1d\nbugs\t\t: cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit\nbogomips\t: 5424.00\nclflush size\t: 64\ncache_alignment\t: 64\naddress sizes\t: 39 bits physical, 48 bits virtual\npower management:\n\n", + "meminfo": "MemTotal: 4030684 kB\nMemFree: 136056 kB\nMemAvailable: 1617860 kB\nBuffers: 247856 kB\nCached: 1605604 kB\nSwapCached: 0 kB\nActive: 2453640 kB\nInactive: 1210080 kB\nActive(anon): 1716900 kB\nInactive(anon): 304704 kB\nActive(file): 736740 kB\nInactive(file): 905376 kB\nUnevictable: 32 kB\nMlocked: 32 kB\nSwapTotal: 728520 kB\nSwapFree: 727740 kB\nDirty: 6016 kB\nWriteback: 0 kB\nAnonPages: 1810328 kB\nMapped: 555224 kB\nShmem: 211204 kB\nKReclaimable: 93756 kB\nSlab: 132608 kB\nSReclaimable: 93756 kB\nSUnreclaim: 38852 kB\nKernelStack: 9880 kB\nPageTables: 41328 kB\nNFS_Unstable: 0 kB\nBounce: 0 kB\nWritebackTmp: 0 kB\nCommitLimit: 2743860 kB\nCommitted_AS: 5258692 kB\nVmallocTotal: 34359738367 kB\nVmallocUsed: 26548 kB\nVmallocChunk: 0 kB\nPercpu: 696 kB\nHardwareCorrupted: 0 kB\nAnonHugePages: 0 kB\nShmemHugePages: 0 kB\nShmemPmdMapped: 0 kB\nCmaTotal: 0 kB\nCmaFree: 0 kB\nHugePages_Total: 0\nHugePages_Free: 0\nHugePages_Rsvd: 0\nHugePages_Surp: 0\nHugepagesize: 2048 kB\nHugetlb: 0 kB\nDirectMap4k: 149440 kB\nDirectMap2M: 4044800 kB\n", + "mounts": "sysfs /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0\nproc /proc proc rw,nosuid,nodev,noexec,relatime 0 0\nudev /dev devtmpfs rw,nosuid,relatime,size=1990752k,nr_inodes=497688,mode=755 0 0\ndevpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0\ntmpfs /run tmpfs rw,nosuid,noexec,relatime,size=403072k,mode=755 0 0\n/dev/sda1 / ext4 rw,relatime,errors=remount-ro 0 0\nsecurityfs /sys/kernel/security securityfs rw,nosuid,nodev,noexec,relatime 0 0\ntmpfs /dev/shm tmpfs rw,nosuid,nodev 0 0\ntmpfs /run/lock tmpfs rw,nosuid,nodev,noexec,relatime,size=5120k 0 0\ntmpfs /sys/fs/cgroup tmpfs ro,nosuid,nodev,noexec,mode=755 0 0\ncgroup /sys/fs/cgroup/unified cgroup2 rw,nosuid,nodev,noexec,relatime,nsdelegate 0 0\ncgroup /sys/fs/cgroup/systemd cgroup rw,nosuid,nodev,noexec,relatime,xattr,name=systemd 0 0\npstore /sys/fs/pstore pstore rw,nosuid,nodev,noexec,relatime 0 0\ncgroup /sys/fs/cgroup/net_cls,net_prio cgroup rw,nosuid,nodev,noexec,relatime,net_cls,net_prio 0 0\ncgroup /sys/fs/cgroup/hugetlb cgroup rw,nosuid,nodev,noexec,relatime,hugetlb 0 0\ncgroup /sys/fs/cgroup/blkio cgroup rw,nosuid,nodev,noexec,relatime,blkio 0 0\ncgroup /sys/fs/cgroup/devices cgroup rw,nosuid,nodev,noexec,relatime,devices 0 0\ncgroup /sys/fs/cgroup/cpuset cgroup rw,nosuid,nodev,noexec,relatime,cpuset 0 0\ncgroup /sys/fs/cgroup/memory cgroup rw,nosuid,nodev,noexec,relatime,memory 0 0\ncgroup /sys/fs/cgroup/perf_event cgroup rw,nosuid,nodev,noexec,relatime,perf_event 0 0\ncgroup /sys/fs/cgroup/freezer cgroup rw,nosuid,nodev,noexec,relatime,freezer 0 0\ncgroup /sys/fs/cgroup/cpu,cpuacct cgroup rw,nosuid,nodev,noexec,relatime,cpu,cpuacct 0 0\ncgroup /sys/fs/cgroup/pids cgroup rw,nosuid,nodev,noexec,relatime,pids 0 0\ncgroup /sys/fs/cgroup/rdma cgroup rw,nosuid,nodev,noexec,relatime,rdma 0 0\nsystemd-1 /proc/sys/fs/binfmt_misc autofs rw,relatime,fd=28,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=13853 0 0\ndebugfs /sys/kernel/debug debugfs rw,relatime 0 0\nhugetlbfs /dev/hugepages hugetlbfs rw,relatime,pagesize=2M 0 0\nmqueue /dev/mqueue mqueue rw,relatime 0 0\nfusectl /sys/fs/fuse/connections fusectl rw,relatime 0 0\nconfigfs /sys/kernel/config configfs rw,relatime 0 0\n/dev/loop0 /snap/gnome-logs/61 squashfs ro,nodev,relatime 0 0\n/dev/loop2 /snap/gtk-common-themes/1313 squashfs ro,nodev,relatime 0 0\n/dev/loop1 /snap/pycharm-community/179 squashfs ro,nodev,relatime 0 0\n/dev/loop3 /snap/core18/1066 squashfs ro,nodev,relatime 0 0\n/dev/loop4 /snap/gnome-calculator/406 squashfs ro,nodev,relatime 0 0\n/dev/loop5 /snap/core18/1668 squashfs ro,nodev,relatime 0 0\n/dev/loop6 /snap/gnome-logs/81 squashfs ro,nodev,relatime 0 0\n/dev/loop7 /snap/gnome-3-28-1804/116 squashfs ro,nodev,relatime 0 0\n/dev/loop8 /snap/gnome-system-monitor/127 squashfs ro,nodev,relatime 0 0\n/dev/loop9 /snap/gnome-calculator/544 squashfs ro,nodev,relatime 0 0\n/dev/loop11 /snap/gnome-characters/296 squashfs ro,nodev,relatime 0 0\n/dev/loop10 /snap/gnome-characters/399 squashfs ro,nodev,relatime 0 0\n/dev/loop12 /snap/gtk-common-themes/1440 squashfs ro,nodev,relatime 0 0\n/dev/loop13 /snap/core/8592 squashfs ro,nodev,relatime 0 0\n/dev/loop14 /snap/core/8689 squashfs ro,nodev,relatime 0 0\n/dev/loop15 /snap/gnome-3-28-1804/67 squashfs ro,nodev,relatime 0 0\n/dev/loop16 /snap/gnome-system-monitor/100 squashfs ro,nodev,relatime 0 0\nbinfmt_misc /proc/sys/fs/binfmt_misc binfmt_misc rw,relatime 0 0\ntmpfs /run/user/1000 tmpfs rw,nosuid,nodev,relatime,size=403068k,mode=700,uid=1000,gid=1000 0 0\ngvfsd-fuse /run/user/1000/gvfs fuse.gvfsd-fuse rw,nosuid,nodev,relatime,user_id=1000,group_id=1000 0 0\n" + }, + "collectd": { + + }, + "postgres": { + "branch": "master", + "commit": "faade5d4c6d8b4f7d46f91702a57529c96aee86e", + "settings": { + "shared_buffers": "1GB", + "work_mem": "64MB", + "maintenance_work_mem": "128MB", + "min_wal_size": "2GB", + "max_wal_size": "4GB", + "log_line_prefix": "%t [%p]: [%l-1] db=%d,user=%u,app=%a,client=%h ", + "log_checkpoints": "on", + "log_autovacuum_min_duration": "0", + "log_temp_files": "32", + "checkpoint_timeout": "30min", + "checkpoint_completion_target": "0.9" + } + }, + "meta": { + "benchmark": "pgbench", + "date": "2020-02-22 04:24:43.000000+00", + "name": "pgbench-basic", + "uname": "Linux hanayozz 5.3.0-40-generic #32~18.04.1-Ubuntu SMP Mon Feb 3 14:05:59 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux\n" + }, + "script": { + "scriptName": "test-script2.sql", + "content": [ + "line 1", + "line 2" + ] + } +} diff --git a/client/scripts/files/insert.sql b/client/scripts/files/insert.sql new file mode 100644 index 0000000..79dbcb4 --- /dev/null +++ b/client/scripts/files/insert.sql @@ -0,0 +1,11 @@ +\set aid random(1, 100000 * :scale) +\set bid random(1, 1 * :scale) +\set tid random(1, 10 * :scale) +\set delta random(-5000, 5000) +BEGIN; +UPDATE pgbench_accounts SET abalance = abalance + :delta WHERE aid = :aid; +SELECT abalance FROM pgbench_accounts WHERE aid = :aid; +UPDATE pgbench_tellers SET tbalance = tbalance + :delta WHERE tid = :tid; +UPDATE pgbench_branches SET bbalance = bbalance + :delta WHERE bid = :bid; +INSERT INTO pgbench_history (tid, bid, aid, delta, mtime) VALUES (:tid, :bid, :aid, :delta, CURRENT_TIMESTAMP); +END; diff --git a/client/scripts/files/pgbench_script.c b/client/scripts/files/pgbench_script.c new file mode 100644 index 0000000..01d35ab --- /dev/null +++ b/client/scripts/files/pgbench_script.c @@ -0,0 +1,37 @@ +static const BuiltinScript builtin_script[] = +{ + { + "tpcb-like", + "", + "\\set aid random(1, " CppAsString2(naccounts) " * :scale)\n" + "\\set bid random(1, " CppAsString2(nbranches) " * :scale)\n" + "\\set tid random(1, " CppAsString2(ntellers) " * :scale)\n" + "\\set delta random(-5000, 5000)\n" + "BEGIN;\n" + "UPDATE pgbench_accounts SET abalance = abalance + :delta WHERE aid = :aid;\n" + "SELECT abalance FROM pgbench_accounts WHERE aid = :aid;\n" + "UPDATE pgbench_tellers SET tbalance = tbalance + :delta WHERE tid = :tid;\n" + "UPDATE pgbench_branches SET bbalance = bbalance + :delta WHERE bid = :bid;\n" + "INSERT INTO pgbench_history (tid, bid, aid, delta, mtime) VALUES (:tid, :bid, :aid, :delta, CURRENT_TIMESTAMP);\n" + "END;\n" + }, + { + "simple-update", + "", + "\\set aid random(1, " CppAsString2(naccounts) " * :scale)\n" + "\\set bid random(1, " CppAsString2(nbranches) " * :scale)\n" + "\\set tid random(1, " CppAsString2(ntellers) " * :scale)\n" + "\\set delta random(-5000, 5000)\n" + "BEGIN;\n" + "UPDATE pgbench_accounts SET abalance = abalance + :delta WHERE aid = :aid;\n" + "SELECT abalance FROM pgbench_accounts WHERE aid = :aid;\n" + "INSERT INTO pgbench_history (tid, bid, aid, delta, mtime) VALUES (:tid, :bid, :aid, :delta, CURRENT_TIMESTAMP);\n" + "END;\n" + }, + { + "select-only", + "", + "\\set aid random(1, " CppAsString2(naccounts) " * :scale)\n" + "SELECT abalance FROM pgbench_accounts WHERE aid = :aid;\n" + } +}; \ No newline at end of file diff --git a/client/scripts/files/test.sql b/client/scripts/files/test.sql new file mode 100644 index 0000000..79dbcb4 --- /dev/null +++ b/client/scripts/files/test.sql @@ -0,0 +1,11 @@ +\set aid random(1, 100000 * :scale) +\set bid random(1, 1 * :scale) +\set tid random(1, 10 * :scale) +\set delta random(-5000, 5000) +BEGIN; +UPDATE pgbench_accounts SET abalance = abalance + :delta WHERE aid = :aid; +SELECT abalance FROM pgbench_accounts WHERE aid = :aid; +UPDATE pgbench_tellers SET tbalance = tbalance + :delta WHERE tid = :tid; +UPDATE pgbench_branches SET bbalance = bbalance + :delta WHERE bid = :bid; +INSERT INTO pgbench_history (tid, bid, aid, delta, mtime) VALUES (:tid, :bid, :aid, :delta, CURRENT_TIMESTAMP); +END; diff --git a/client/settings.py b/client/settings.py index 0a4f31f..dd521a7 100644 --- a/client/settings.py +++ b/client/settings.py @@ -1,12 +1,15 @@ import os import sys -# global configuration -GIT_URL = 'https://github.com/postgres/postgres.git' -REPOSITORY_PATH = '/tmp/git-postgres' -BUILD_PATH = '/Users/chenzhang/anaconda3' +# global configuration/Users/chenzhang +# GIT_URL = 'https://github.com/postgres/postgres.git' +GIT_URL = 'https://gitee.com/purpleyu/postgres.git' # changed to a local repo +REPOSITORY_PATH = '/raid/git-postgres' +# BUILD_PATH = '/Users/chenzhang/anaconda3' +BUILD_PATH = '/usr/lib/postgresql/11' BIN_PATH = os.path.join(BUILD_PATH, 'bin') -DATADIR_PATH = '/tmp/data-postgres' +DATADIR_PATH = '/raid/data-postgres' +SCRIPTS_DIR = 'scripts/files/' POSTGRES_CONFIG = { 'shared_buffers': '1GB', @@ -22,23 +25,32 @@ 'checkpoint_completion_target': '0.9', } -DATABASE_NAME = 'postgres' # This name needs to be the same as rest_api settings_local.py database NAME +DATABASE_NAME = 'postgres' # This name needs to be the same as rest_api settings_local.py database NAME -OUTPUT_DIR = '/tmp/perf-output' +OUTPUT_DIR = '/raid/perf-output' # configuration for PgBench # runs - number of repetitions (including test for all client counts) # duration - duration (in seconds) of a single benchmark (per client count) PGBENCH_CONFIG = { 'runs': 3, - 'duration': 600, + 'duration': 1, # 600 'csv': False } +# Benchmarking options for PgBench +# clients - number of concurrent database sessions +# threads - number of worker threads within PgBench +PGBENCH_BENCHMARKING_OPTIONS = { + 'scale': 10, + 'clients': [1, 2, 4], + 'threads': 1 +} + # ignore missing file with local config try: from settings_local import * except Exception as e: - print (sys.stderr, "ERROR: local configuration (settings_local.py) " \ - "not found") + print(sys.stderr, "ERROR: local configuration (settings_local.py) " \ + "not found") sys.exit(1) diff --git a/client/test.py b/client/test.py new file mode 100644 index 0000000..b87de3e --- /dev/null +++ b/client/test.py @@ -0,0 +1,56 @@ +#!/usr/bin/env python3 +import glob +import os +import pathlib +import subprocess, psycopg2, sys +import json + +from settings import SCRIPTS_DIR + +if __name__ == '__main__': + + print(os.path.exists('scripts/files/test2.sql')) + path = pathlib.Path('scripts/files/test2.sql') + print(path) + + # DBNAME = 'TestDB' + # DBUSER = 'postgres' + # DBPASSWORD='password' + # DBHOST='127.0.0.1' + # DBPOT='5432' + # table_name ='testdb' + + # print('dbname={} user={}'.format(DBNAME, DBUSER)) + # sys.exit() + + # delete the pgbench DB if it already exists + # input("About to drop the pgbench database! Press 'Ctrl-C' to cancel or 'Return' to continue.") + # subprocess.call(['dropdb', 'pgbench']) + # create the test database + # subprocess.call(['createdb', 'pgbench']) + # initialize the test database with some stock pgbench options + subprocess.call(['pgbench', '-f', '/home/susan/PythonClass/django-postgres-stack/client/tmp/files/insert.sql','-f', '/home/susan/PythonClass/django-postgres-stack/client/tmp/files/test.sql', DBNAME]) + + + + # psycopg2.connect(database="testdb", user="postgres", password="cohondob", host="127.0.0.1", port="5432") + # scriptList= [] + # scriptContent = [] + # scriptDir = SCRIPTS_DIR + # if os.path.exists(scriptDir): + # sqlScript = glob.glob(scriptDir + "/*.sql") + # + # for script in sqlScript: + # scriptObj = {} + # # fp = open(script, 'r') + # # for line in fp.readlines(): + # # scriptContent.append(line) + # # fp.close() + # # scriptObj["content"] = scriptContent + # scriptObj["scriptName"] = os.path.basename(script) + # scriptList.append(scriptObj) + # json = json.dumps(scriptList) + # print("collecting self-design script json: " + json) + # + # else: + # print("collecting self-design script files Error: " + scriptDir + " not exists") \ No newline at end of file diff --git a/rest_api/apps/machines/models.py b/rest_api/apps/machines/models.py index c9bc731..d45f10f 100644 --- a/rest_api/apps/machines/models.py +++ b/rest_api/apps/machines/models.py @@ -29,7 +29,7 @@ class Machine(models.Model): add_time = models.DateTimeField(auto_now_add=True) alias = models.CharField(max_length=100, blank=True, default='') - machine_secret = models.CharField(max_length=32, blank=True, default='', verbose_name="machine secret") + machine_secret = models.CharField(max_length=100, blank=True, default='', verbose_name="machine secret") sn = models.CharField(max_length=16, blank=True, default='') os_name = models.CharField(max_length=100, blank=True, default='') os_version = models.CharField(max_length=100, blank=True, default='') diff --git a/rest_api/apps/records/models.py b/rest_api/apps/records/models.py index 64b2e2f..8146739 100644 --- a/rest_api/apps/records/models.py +++ b/rest_api/apps/records/models.py @@ -10,10 +10,11 @@ class TestBranch(models.Model): """ test branch """ - branch_name = models.CharField(max_length=128, unique=True,verbose_name="branch name", help_text="branch name") - branch_order = models.IntegerField(default=5,verbose_name="branch order", help_text="order in all the branch") - is_show = models.BooleanField(verbose_name="branch is shown", default=True, help_text="branch isshow") - is_accept = models.BooleanField(verbose_name="branch accepts new reports", default=True, help_text="branch accepts new reports") + branch_name = models.CharField(max_length=128, unique=True, verbose_name="branch name", help_text="branch name") + branch_order = models.IntegerField(default=5, verbose_name="branch order", help_text="order in all the branch") + is_show = models.BooleanField(verbose_name="branch is shown", default=True, help_text="branch is show") + is_accept = models.BooleanField(verbose_name="branch accepts new reports", default=True, + help_text="branch accepts new reports") add_time = models.DateTimeField(default=timezone.now, verbose_name="branch added time", help_text="branch added time") @@ -43,23 +44,27 @@ def __str__(self): class PGInfo(models.Model): - - checkpoint_timeout = models.CharField(max_length=32, verbose_name="checkpoint_timeout", help_text="checkpoint_timeout") + checkpoint_timeout = models.CharField(max_length=32, verbose_name="checkpoint_timeout", + help_text="checkpoint_timeout") log_temp_files = models.IntegerField(verbose_name="log_temp_files", help_text="log_temp_files") work_mem = models.CharField(max_length=32, verbose_name="work_mem", help_text="work_mem") - log_line_prefix = models.CharField(max_length=64,verbose_name="checkpoint_timeout", help_text="checkpoint_timeout") + log_line_prefix = models.CharField(max_length=64, verbose_name="checkpoint_timeout", help_text="checkpoint_timeout") shared_buffers = models.CharField(max_length=32, verbose_name="shared_buffers", help_text="shared_buffers") - log_autovacuum_min_duration =models.IntegerField(verbose_name="log_autovacuum_min_duration", help_text="log_autovacuum_min_duration") - + log_autovacuum_min_duration = models.IntegerField(verbose_name="log_autovacuum_min_duration", + help_text="log_autovacuum_min_duration") - checkpoint_completion_target = models.DecimalField(max_digits=8, decimal_places=4,verbose_name="checkpoint_completion_target", help_text="checkpoint_completion_target") - maintenance_work_mem = models.CharField(max_length=32, verbose_name="maintenance_work_mem", help_text="maintenance_work_mem") + checkpoint_completion_target = models.DecimalField(max_digits=8, decimal_places=4, + verbose_name="checkpoint_completion_target", + help_text="checkpoint_completion_target") + maintenance_work_mem = models.CharField(max_length=32, verbose_name="maintenance_work_mem", + help_text="maintenance_work_mem") SWITCH_CHOICE = ( (1, 'on'), (2, 'off') ) - log_checkpoints = models.IntegerField(choices=SWITCH_CHOICE,verbose_name="log_checkpoints", help_text="log_checkpoints") + log_checkpoints = models.IntegerField(choices=SWITCH_CHOICE, verbose_name="log_checkpoints", + help_text="log_checkpoints") max_wal_size = models.CharField(max_length=32, verbose_name="max_wal_size", help_text="max_wal_size") min_wal_size = models.CharField(max_length=32, verbose_name="min_wal_size", help_text="min_wal_size") @@ -117,7 +122,7 @@ class TestRecord(models.Model): hash = models.CharField(unique=True, default='', max_length=128, verbose_name="record hash", help_text="record hash") uuid = models.CharField(unique=True, default='', max_length=64, verbose_name="record uuid", help_text="record uuid") - commit = models.CharField(max_length=64, verbose_name="record commit", help_text="record commit") + commit = models.CharField(max_length=100, verbose_name="record commit", help_text="record commit") add_time = models.DateTimeField(default=timezone.now, verbose_name="test added time") @@ -169,7 +174,7 @@ def calc_status(sender, instance, **kwargs): machine_id = instance.test_record.test_machine_id add_time = instance.test_record.add_time branch = instance.test_record.branch - prevRecord = TestRecord.objects.order_by('-add_time').filter(test_machine_id=machine_id,branch=branch, + prevRecord = TestRecord.objects.order_by('-add_time').filter(test_machine_id=machine_id, branch=branch, add_time__lt=add_time).first() if (prevRecord == None): print("prev record not found") @@ -184,9 +189,9 @@ def calc_status(sender, instance, **kwargs): percentage = (instance.metric - prevTestDataSet.metric) / prevTestDataSet.metric status = 0 - if (percentage >= 0.05): + if percentage >= 0.05: status = 1 - elif (percentage <= -0.05): + elif percentage <= -0.05: status = 3 else: status = 2 @@ -199,15 +204,14 @@ def calc_status(sender, instance, **kwargs): class TestResult(models.Model): - test_dataset = models.ForeignKey(TestDataSet, verbose_name="test dataset id", help_text="test dataset id") latency = models.IntegerField(verbose_name="latency", help_text="latency of the test result") scale = models.IntegerField(verbose_name="scale", help_text="scale of the test result") end = models.DecimalField(max_digits=32, decimal_places=12, verbose_name="end", - help_text="endtime of the test result") + help_text="end time of the test result") clients = models.IntegerField(verbose_name="clients", help_text="clients of the test result") start = models.DecimalField(max_digits=32, decimal_places=12, verbose_name="start", - help_text="starttime of the test result") + help_text="start time of the test result") tps = models.DecimalField(default=0, max_digits=18, decimal_places=6, verbose_name="tps", help_text="tps of the test result") run = models.IntegerField(verbose_name="run", help_text="run number") @@ -224,3 +228,17 @@ class TestResult(models.Model): class Meta: verbose_name = "test result" verbose_name_plural = "test result" + + +class TestScript(models.Model): + test_result = models.ForeignKey(TestResult, verbose_name="test result id", help_text="test result id") + # customScripts = models.CharField(max_length=10000, verbose_name="custom scripts", + # help_text="custom scripts", default="TPC-B") + scriptName = models.CharField(max_length=100, verbose_name="custom scripts name", + help_text="custom scripts name", default="TPC-B") + script = models.FileField(verbose_name="custom scripts file", upload_to="scripts/") + add_time = models.DateTimeField(default=timezone.now, verbose_name="custom scripts list added time") + + class Meta: + verbose_name = "custom script list" + verbose_name_plural = "custom script list" diff --git a/rest_api/apps/records/serializers.py b/rest_api/apps/records/serializers.py index 74ba84a..a6ca04b 100644 --- a/rest_api/apps/records/serializers.py +++ b/rest_api/apps/records/serializers.py @@ -1,7 +1,7 @@ from rest_framework import serializers from rest_api.settings import DB_ENUM -from records.models import TestRecord, TestResult, PGInfo, LinuxInfo, MetaInfo, TestDataSet, TestCategory, TestBranch +from records.models import TestRecord, TestResult, PGInfo, LinuxInfo, MetaInfo, TestDataSet, TestScript, TestCategory, TestBranch from machines.models import Machine from machines.serializers import MachineSerializer, MachineRecordSerializer from django.db.models import Count @@ -184,6 +184,11 @@ class Meta: model = TestDataSet fields = "__all__" +class CreateTestScriptSerializer(serializers.ModelSerializer): + + class Meta: + model = TestScript + fields = "__all__" class TestStatusRecordListSerializer(serializers.ModelSerializer): diff --git a/rest_api/apps/records/urls.py b/rest_api/apps/records/urls.py index 15d9074..d537d85 100644 --- a/rest_api/apps/records/urls.py +++ b/rest_api/apps/records/urls.py @@ -1,6 +1,11 @@ from django.conf.urls import include, url from rest_framework.routers import DefaultRouter from records import views +from rest_api import settings +from django.views.static import serve +from django.views.generic import TemplateView + + router = DefaultRouter() router.register(r'all-records', views.TestRecordListViewSet, base_name="records"), @@ -12,5 +17,6 @@ urlpatterns = [ url(r'^', include(router.urls)), - url(r'upload/$', views.TestRecordCreate, name="test-upload") + url(r'upload/$', views.TestRecordCreate, name="test-upload"), + url(r'scripts/(?P.*)$', serve, {"document_root": settings.MEDIA_ROOT})#http://127.0.0.1:8000/scripts/scripts/insert.sql ] \ No newline at end of file diff --git a/rest_api/apps/records/views.py b/rest_api/apps/records/views.py index a50fe7d..52ba1da 100644 --- a/rest_api/apps/records/views.py +++ b/rest_api/apps/records/views.py @@ -10,6 +10,7 @@ from records.exception import TestDataUploadError from records.filters import TestRecordListFilter from machines.models import Machine +from django.contrib.auth.models import User from records.models import TestCategory, TestBranch from rest_api.settings import DB_ENUM from records.serializers import * @@ -24,257 +25,373 @@ class StandardResultsSetPagination(PageNumberPagination): - page_size = 20 - page_size_query_param = 'page_size' - max_page_size = 100 + page_size = 20 + page_size_query_param = 'page_size' + max_page_size = 100 class BigResultsSetPagination(PageNumberPagination): - page_size = 1000 - page_size_query_param = 'page_size' + page_size = 1000 + page_size_query_param = 'page_size' class TestBranchListViewSet(viewsets.ModelViewSet): - """ + """ List test branches """ - queryset = TestBranch.objects.all().order_by('branch_order','add_time') - serializer_class = TestBranchSerializer - pagination_class = BigResultsSetPagination + queryset = TestBranch.objects.all().order_by('branch_order', 'add_time') + serializer_class = TestBranchSerializer + pagination_class = BigResultsSetPagination class TestCategoryViewSet(viewsets.ModelViewSet): - """ + """ List test categories """ - queryset = TestCategory.objects.all().order_by('cate_name') - serializer_class = TestCategorySerializer - pagination_class = StandardResultsSetPagination + queryset = TestCategory.objects.all().order_by('cate_name') + serializer_class = TestCategorySerializer + pagination_class = StandardResultsSetPagination class TestRecordListViewSet(mixins.ListModelMixin, viewsets.GenericViewSet): - """ + """ List test records """ - queryset = TestRecord.objects.all().order_by('add_time') - serializer_class = TestRecordListSerializer - pagination_class = StandardResultsSetPagination - filter_backends = (django_filters.rest_framework.DjangoFilterBackend,) - lookup_field = 'uuid' - permission_classes = (permissions.AllowAny, ) + queryset = TestRecord.objects.all().order_by('add_time') + serializer_class = TestRecordListSerializer + pagination_class = StandardResultsSetPagination + filter_backends = (django_filters.rest_framework.DjangoFilterBackend,) + lookup_field = 'uuid' + permission_classes = (permissions.AllowAny,) class TestRecordDetailViewSet(mixins.RetrieveModelMixin, viewsets.GenericViewSet): - """ + """ Detail test records """ - lookup_field = 'uuid' - queryset = TestRecord.objects.all().order_by('add_time') - serializer_class = TestRecordDetailSerializer - permission_classes = (permissions.AllowAny, ) + lookup_field = 'uuid' + queryset = TestRecord.objects.all().order_by('add_time') + serializer_class = TestRecordDetailSerializer + permission_classes = (permissions.AllowAny,) class MachineHistoryRecordViewSet(mixins.RetrieveModelMixin, viewsets.GenericViewSet): - """ + """ Machine info page """ - lookup_field = 'sn' - queryset = Machine.objects.all().order_by('add_time') - serializer_class = MachineHistoryRecordSerializer - permission_classes = (permissions.AllowAny, ) + lookup_field = 'sn' + queryset = Machine.objects.all().order_by('add_time') + serializer_class = MachineHistoryRecordSerializer + permission_classes = (permissions.AllowAny,) class TestRecordListByBranchViewSet(mixins.ListModelMixin, viewsets.GenericViewSet): - """ + """ List test records (/status) """ - queryset = TestRecord.objects.order_by('test_machine__alias','-add_time').distinct('test_machine__alias').all() - serializer_class = TestRecordListSerializer - pagination_class = StandardResultsSetPagination - filter_backends = (django_filters.rest_framework.DjangoFilterBackend,) - permission_classes = (permissions.IsAuthenticatedOrReadOnly, ) + queryset = TestRecord.objects.order_by('test_machine__alias', '-add_time').distinct('test_machine__alias').all() + serializer_class = TestRecordListSerializer + pagination_class = StandardResultsSetPagination + filter_backends = (django_filters.rest_framework.DjangoFilterBackend,) + permission_classes = (permissions.IsAuthenticatedOrReadOnly,) -@api_view(['POST']) -@permission_classes((permissions.AllowAny, )) +@api_view(['GET', 'POST']) +@permission_classes((permissions.AllowAny,)) def TestRecordCreate(request, format=None): - """ - Receive data from client - """ - data = request.data - - json_data = json.dumps(data[0], ensure_ascii=False) - json_data = json.loads(json_data) - # obj = data[0].pgbench - # jsLoads = json.loads(data[0]) - - from django.db import transaction - - try: - secret = request.META.get("HTTP_AUTHORIZATION") - ret = Machine.objects.filter(machine_secret=secret, state='A').get() - test_machine = ret.id - if test_machine <= 0: - raise TestDataUploadError("The machine is unavailable.") - - record_hash = make_password(str(json_data), 'pg_perf_farm') - r = TestRecord.objects.filter(hash=record_hash).count() - if r != 0: - raise TestDataUploadError('The same record already exists, please do not submit it twice.') - - with transaction.atomic(): - - if 'linux' not in json_data: - print('linuxInfo not found') - linuxInfo = LinuxInfoSerializer(data={'mounts': 'none', 'cpuinfo': 'none', 'sysctl': 'none', 'meminfo': 'none'}) - else: - linux_data = json_data['linux'] - linuxInfo = LinuxInfoSerializer(data=linux_data) - linuxInfoRet = None - - if linuxInfo.is_valid(): - linuxInfoRet = linuxInfo.save() - - else: - msg = 'linuxInfo invalid' - raise TestDataUploadError(msg) - - meta_data = json_data['meta'] - metaInfo = MetaInfoSerializer(data=meta_data) - metaInfoRet = None - if metaInfo.is_valid(): - metaInfoRet = metaInfo.save() - else: - msg = 'metaInfo invalid' - raise TestDataUploadError(msg) - - pg_data = json_data['postgres'] - branch_str = pg_data['branch'] - - if (branch_str == 'master'): - branch_str = 'HEAD' - - branch = TestBranch.objects.filter(branch_name__iexact=branch_str, is_accept=True).get() - - if not branch: - raise TestDataUploadError('The branch name is unavailable.') - - commit = pg_data['commit'] - pg_settings = pg_data['settings'] - - filtered = ['checkpoint_timeout','work_mem','shared_buffers','maintenance_work_mem','max_wal_size','min_wal_size'] - - for item in filtered: - if item.isdigit(): - pg_settings[item] = int(pg_settings[item]) - # pg_settings[item] = pg_settings[item].encode('utf-8') - # pg_settings[item] = filter(str.isdigit, pg_settings[item]) - - pg_settings['log_checkpoints'] = DB_ENUM['general_switch'][pg_settings['log_checkpoints']] - pgInfo = CreatePGInfoSerializer(data=pg_settings) - pgInfoRet = None - - if pgInfo.is_valid(): - pgInfoRet = pgInfo.save() - - else: - msg = pgInfo.errors - raise TestDataUploadError(msg) - - test_record_data = { - 'pg_info': pgInfoRet.id, - 'linux_info': linuxInfoRet.id, - 'meta_info': metaInfoRet.id, - 'test_machine': test_machine, - 'test_desc': 'here is desc', - 'meta_time': metaInfoRet.date, - 'hash': record_hash, - 'commit': commit, - 'branch': branch.id, - 'uuid': shortuuid.uuid() - } - - testRecord = CreateTestRecordSerializer(data=test_record_data) - testRecordRet = None - - if testRecord.is_valid(): - testRecordRet = testRecord.save() - - else: - msg = 'testRecord invalid' - print(testRecord.errors) - raise TestDataUploadError(msg) - - pgbench = json_data['pgbench'] - # print(type(ro)) - ro = pgbench['ro'] - - #for tag, tag_list in pgbench.iteritems(): - for tag, tag_list in pgbench.items(): - #print(tag) - #print(tag_list) - - test_cate = TestCategory.objects.get(cate_sn=tag) - - if not test_cate: - continue - else: - print(test_cate.cate_name) - - for scale, dataset_list in tag_list.items(): - - for client_num, dataset in dataset_list.items(): - - test_dataset_data = { - 'test_record': testRecordRet.id, - 'clients': client_num, - 'scale': scale, - 'std': dataset['std'], - 'metric': dataset['metric'], - 'median': dataset['median'], - 'test_cate': test_cate.id, - # status, percentage will calc by receiver - 'status': -1, - 'percentage': 0.0, - } - - testDateSet = CreateTestDateSetSerializer(data=test_dataset_data) - testDateSetRet = None - - if testDateSet.is_valid(): - testDateSetRet = testDateSet.save() - else: - print(testDateSet.errors) - msg = 'testDateSet invalid' - raise TestDataUploadError(msg) + if request.method == 'GET': + test_results = TestResult.objects.all() + serializer = TestResultSerializer(test_results, many=True) + return Response(serializer.data) + + elif request.method == 'POST': + + """ + Receive data and files from client + """ + + data = request.data + json_data = data['json'] + json_data = json.loads(json_data) + files = request.FILES + + from django.db import transaction + try: + secret = request.META.get("HTTP_AUTHORIZATION") + print(secret) + test_machine = None + try: + ret = Machine.objects.filter(machine_secret=secret, state='A').get() + test_machine = ret.id + except Machine.DoesNotExist: + current_user = User.objects.get(username='gsoccamp') + new_machine = Machine.objects.create(alias='dummy_alias', machine_secret=secret, sn='dummy_sn', + os_name='dummy_os_name', os_version='dummy_os_version', + comp_name='dummy_comp_name', comp_version='dummy_comp_version', + state='Inactive', owner_id=current_user, + owner_email='dummy_owner_email', + owner_username='dummy_owner_username') + new_machine.save() + ret = Machine.objects.filter(machine_secret=secret).get() + test_machine = ret.id + if test_machine == None or test_machine <= 0: + raise TestDataUploadError("The machine is unavailable.") + + record_hash = make_password(str(json_data), 'pg_perf_farm') + r = TestRecord.objects.filter(hash=record_hash).count() + if r != 0: + raise TestDataUploadError('The same record already exists, please do not submit it twice.') + + print("Atomic transaction begins.") + with transaction.atomic(): + + if 'linux' not in json_data: + print('linuxInfo not found') + linuxInfo = LinuxInfoSerializer( + data={'mounts': 'none', 'cpuinfo': 'none', 'sysctl': 'none', 'meminfo': 'none'}) + + else: + linux_data = json_data['linux'] + linuxInfo = LinuxInfoSerializer(data=linux_data) + linuxInfoRet = None + + if linuxInfo.is_valid(): + linuxInfoRet = linuxInfo.save() + + else: + msg = 'linuxInfo invalid' + raise TestDataUploadError(msg) + + meta_data = json_data['meta'] + metaInfo = MetaInfoSerializer(data=meta_data) + metaInfoRet = None + if metaInfo.is_valid(): + metaInfoRet = metaInfo.save() + else: + msg = 'metaInfo invalid' + raise TestDataUploadError(msg) + + pg_data = json_data['postgres'] + branch_str = pg_data['branch'] + + if (branch_str == 'master'): + branch_str = 'HEAD' + + branch = None + try: + branch = TestBranch.objects.filter(branch_name__iexact=branch_str, is_accept=True).get() + except TestBranch.DoesNotExist: + new_branch = TestBranch.objects.create(branch_name=branch_str, branch_order=5, is_show=True, + is_accept=True) + new_branch.save() + branch = TestBranch.objects.filter(branch_name__iexact=branch_str, is_accept=True).get() + + if not branch: + raise TestDataUploadError('The branch name is unavailable.') + + commit = pg_data['commit'] + pg_settings = pg_data['settings'] + + filtered = ['checkpoint_timeout', 'work_mem', 'shared_buffers', 'maintenance_work_mem', 'max_wal_size', + 'min_wal_size'] + for item in filtered: + if item.isdigit(): + pg_settings[item] = int(pg_settings[item]) + # pg_settings[item] = pg_settings[item].encode('utf-8') + # pg_settings[item] = filter(str.isdigit, pg_settings[item]) + + pg_settings['log_checkpoints'] = DB_ENUM['general_switch'][pg_settings['log_checkpoints']] + pgInfo = CreatePGInfoSerializer(data=pg_settings) + pgInfoRet = None + + if pgInfo.is_valid(): + pgInfoRet = pgInfo.save() + + else: + msg = pgInfo.errors + raise TestDataUploadError(msg) + + print("test record data begins") + test_record_data = { + 'pg_info': pgInfoRet.id, + 'linux_info': linuxInfoRet.id, + 'meta_info': metaInfoRet.id, + 'test_machine': test_machine, + 'test_desc': 'here is desc', + 'meta_time': metaInfoRet.date, + 'hash': record_hash, + 'commit': commit, + 'branch': branch.id, + 'uuid': shortuuid.uuid() + } + + testRecord = CreateTestRecordSerializer(data=test_record_data) + testRecordRet = None + + if testRecord.is_valid(): + testRecordRet = testRecord.save() + + else: + msg = 'testRecord invalid' + print(testRecord.errors) + raise TestDataUploadError(msg) + + pgbench = json_data['pgbench'] + # print(type(ro)) + ro = pgbench['ro'] + + # for tag, tag_list in pgbench.iteritems(): + for tag, tag_list in pgbench.items(): + if tag == 'ro' or tag == 'rw': + test_cate = None + try: + test_cate = TestCategory.objects.get(cate_sn=tag) + except TestCategory.DoesNotExist: + new_test_cate = TestCategory.objects.create(cate_sn=tag, cate_name=tag + "_category", + cate_order=1) + new_test_cate.save() + test_cate = TestCategory.objects.get(cate_sn=tag) + + if not test_cate: + continue + else: + print(test_cate.cate_name) + + for scale, dataset_list in tag_list.items(): + + for client_num, dataset in dataset_list.items(): + + test_dataset_data = { + 'test_record': testRecordRet.id, + 'clients': client_num, + 'scale': scale, + 'std': round(dataset['std'], 7), + 'metric': round(dataset['metric'], 7), + 'median': round(dataset['median'], 7), + 'test_cate': test_cate.id, + # status, percentage will calc by receiver + 'status': -1, + 'percentage': 0.0, + } + + testDateSet = CreateTestDateSetSerializer(data=test_dataset_data) + testDateSetRet = None + + if testDateSet.is_valid(): + testDateSetRet = testDateSet.save() + else: + print(testDateSet.errors) + msg = 'testDateSet invalid' + raise TestDataUploadError(msg) + + test_result_list = dataset['results'] + + for test_result in test_result_list: + test_result_data = test_result + test_result_data['test_dataset'] = testDateSetRet.id + test_result_data['mode'] = DB_ENUM['mode'][test_result_data['mode']] + testResult = CreateTestResultSerializer(data=test_result_data) + + testResultRet = None + + if testResult.is_valid(): + testResultRet = testResult.save() + + else: + print(testResult.errors) + msg = testResult.errors + raise TestDataUploadError(msg) + else: + tag = 'customeScript' + dataset = pgbench['customeScript'] + test_cate = None + try: + test_cate = TestCategory.objects.get(cate_sn=tag) + except TestCategory.DoesNotExist: + new_test_cate = TestCategory.objects.create(cate_sn=tag, cate_name=tag + "_category", + cate_order=1) + new_test_cate.save() + test_cate = TestCategory.objects.get(cate_sn=tag) + + if not test_cate: + continue + else: + print(test_cate.cate_name) + + scale = 10 + client_num = 1 + + test_dataset_data = { + 'test_record': testRecordRet.id, + 'clients': client_num, + 'scale': scale, + 'std': round(dataset['std'], 7), + 'metric': round(dataset['metric'], 7), + 'median': round(dataset['median'], 7), + 'test_cate': test_cate.id, + # status, percentage will calc by receiver + 'status': -1, + 'percentage': 0.0, + } + + testDateSet = CreateTestDateSetSerializer(data=test_dataset_data) + testDateSetRet = None + + if testDateSet.is_valid(): + testDateSetRet = testDateSet.save() + else: + print(testDateSet.errors) + msg = 'testDateSet invalid' + raise TestDataUploadError(msg) + + test_result_list = dataset['results'] + + for test_result in test_result_list: + test_result_data = test_result + test_result_data['test_dataset'] = testDateSetRet.id + test_result_data['mode'] = DB_ENUM['mode'][test_result_data['mode']] + test_result_data['run'] = 0 + testResult = CreateTestResultSerializer(data=test_result_data) + + testResultRet = None + + if testResult.is_valid(): + testResultRet = testResult.save() + + else: + print(testResult.errors) + msg = testResult.errors + raise TestDataUploadError(msg) + + test_script_list = dataset['scriptList'] + + for test_script in test_script_list: + test_script_data = test_script + test_script_data['test_result'] = testResultRet.id + test_script_data['script'] = files[test_script_data['scriptName']] + testScript = CreateTestScriptSerializer(data=test_script_data) + + testScriptRet = None + + if testScript.is_valid(): + testScriptRet = testScript.save() + + else: + print(testScript.errors) + msg = testScript.errors + raise TestDataUploadError(msg) + + + + except Exception as e: + msg = 'Upload error: ' + e.__str__() + print(msg) + return Response(msg, status=status.HTTP_406_NOT_ACCEPTABLE) + + print('Upload successful!') + return Response(status=status.HTTP_201_CREATED) - test_result_list = dataset['results'] - - for test_result in test_result_list: - test_result_data = test_result - test_result_data['test_dataset'] = testDateSetRet.id - test_result_data['mode'] = DB_ENUM['mode'][test_result_data['mode']] - testResult = CreateTestResultSerializer(data=test_result_data) - - testResultRet = None - - if testResult.is_valid(): - testResultRet = testResult.save() - - else: - print(testResult.errors) - msg = testResult.errors - raise TestDataUploadError(msg) - - - except Exception as e: - msg = 'Upload error: ' + e.__str__() - print(msg) - return Response(msg, status=status.HTTP_406_NOT_ACCEPTABLE) - - print('Upload successful!') - return Response(status=status.HTTP_201_CREATED) diff --git a/rest_api/requirements.txt b/rest_api/requirements.txt index d17208a..a88d49e 100644 --- a/rest_api/requirements.txt +++ b/rest_api/requirements.txt @@ -45,3 +45,4 @@ xlrd==1.1.0 xlwt==1.3.0 psycopg2==2.8.2 pygments==2.4.2 +numpy==1.18.1 \ No newline at end of file diff --git a/rest_api/rest_api/settings.py b/rest_api/rest_api/settings.py index d6cdb17..e2bcfab 100644 --- a/rest_api/rest_api/settings.py +++ b/rest_api/rest_api/settings.py @@ -246,3 +246,6 @@ # https://docs.djangoproject.com/en/1.11/howto/static-files/ STATIC_URL = '/static/' + +MEDIA_URL = '/scripts/' +MEDIA_ROOT = os.path.join(BASE_DIR, 'scripts') diff --git a/rest_api/rest_api/settings_local.py b/rest_api/rest_api/settings_local.py index 29bc0bd..d612550 100644 --- a/rest_api/rest_api/settings_local.py +++ b/rest_api/rest_api/settings_local.py @@ -3,11 +3,11 @@ DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', - 'NAME': 'postgres', # data_base name - 'USER': 'chenzhang', + 'NAME': 'pgperffarm-db', + 'USER': 'postgres', 'PASSWORD': 'password', - #'HOST': '/var/run/postgresql' - 'HOST': '/tmp' + 'HOST': '/var/run/postgresql' + #'HOST': '/raid' } } @@ -19,4 +19,4 @@ PGAUTH_KEY = '' EMAIL_HOST_USER = '' -EMAIL_HOST_PASSWORD = '' # individual smtp password +EMAIL_HOST_PASSWORD = '' # individual smtp password \ No newline at end of file diff --git a/rest_api/rest_api/settings_local.py.in b/rest_api/rest_api/settings_local.py.in index de91134..41d131e 100644 --- a/rest_api/rest_api/settings_local.py.in +++ b/rest_api/rest_api/settings_local.py.in @@ -7,7 +7,7 @@ DATABASES = { 'USER': 'chenzhang', 'PASSWORD': 'password', #'HOST': '/var/run/postgresql' - 'HOST': '/tmp' + 'HOST': '/raid' } } diff --git a/rest_api/scripts/scripts/insert.sql b/rest_api/scripts/scripts/insert.sql new file mode 100644 index 0000000..79dbcb4 --- /dev/null +++ b/rest_api/scripts/scripts/insert.sql @@ -0,0 +1,11 @@ +\set aid random(1, 100000 * :scale) +\set bid random(1, 1 * :scale) +\set tid random(1, 10 * :scale) +\set delta random(-5000, 5000) +BEGIN; +UPDATE pgbench_accounts SET abalance = abalance + :delta WHERE aid = :aid; +SELECT abalance FROM pgbench_accounts WHERE aid = :aid; +UPDATE pgbench_tellers SET tbalance = tbalance + :delta WHERE tid = :tid; +UPDATE pgbench_branches SET bbalance = bbalance + :delta WHERE bid = :bid; +INSERT INTO pgbench_history (tid, bid, aid, delta, mtime) VALUES (:tid, :bid, :aid, :delta, CURRENT_TIMESTAMP); +END; diff --git a/rest_api/scripts/scripts/insert_RnVuHYV.sql b/rest_api/scripts/scripts/insert_RnVuHYV.sql new file mode 100644 index 0000000..79dbcb4 --- /dev/null +++ b/rest_api/scripts/scripts/insert_RnVuHYV.sql @@ -0,0 +1,11 @@ +\set aid random(1, 100000 * :scale) +\set bid random(1, 1 * :scale) +\set tid random(1, 10 * :scale) +\set delta random(-5000, 5000) +BEGIN; +UPDATE pgbench_accounts SET abalance = abalance + :delta WHERE aid = :aid; +SELECT abalance FROM pgbench_accounts WHERE aid = :aid; +UPDATE pgbench_tellers SET tbalance = tbalance + :delta WHERE tid = :tid; +UPDATE pgbench_branches SET bbalance = bbalance + :delta WHERE bid = :bid; +INSERT INTO pgbench_history (tid, bid, aid, delta, mtime) VALUES (:tid, :bid, :aid, :delta, CURRENT_TIMESTAMP); +END; diff --git a/rest_api/scripts/scripts/insert_iptUqs8.sql b/rest_api/scripts/scripts/insert_iptUqs8.sql new file mode 100644 index 0000000..79dbcb4 --- /dev/null +++ b/rest_api/scripts/scripts/insert_iptUqs8.sql @@ -0,0 +1,11 @@ +\set aid random(1, 100000 * :scale) +\set bid random(1, 1 * :scale) +\set tid random(1, 10 * :scale) +\set delta random(-5000, 5000) +BEGIN; +UPDATE pgbench_accounts SET abalance = abalance + :delta WHERE aid = :aid; +SELECT abalance FROM pgbench_accounts WHERE aid = :aid; +UPDATE pgbench_tellers SET tbalance = tbalance + :delta WHERE tid = :tid; +UPDATE pgbench_branches SET bbalance = bbalance + :delta WHERE bid = :bid; +INSERT INTO pgbench_history (tid, bid, aid, delta, mtime) VALUES (:tid, :bid, :aid, :delta, CURRENT_TIMESTAMP); +END; diff --git a/rest_api/scripts/scripts/insert_kfpzQ63.sql b/rest_api/scripts/scripts/insert_kfpzQ63.sql new file mode 100644 index 0000000..79dbcb4 --- /dev/null +++ b/rest_api/scripts/scripts/insert_kfpzQ63.sql @@ -0,0 +1,11 @@ +\set aid random(1, 100000 * :scale) +\set bid random(1, 1 * :scale) +\set tid random(1, 10 * :scale) +\set delta random(-5000, 5000) +BEGIN; +UPDATE pgbench_accounts SET abalance = abalance + :delta WHERE aid = :aid; +SELECT abalance FROM pgbench_accounts WHERE aid = :aid; +UPDATE pgbench_tellers SET tbalance = tbalance + :delta WHERE tid = :tid; +UPDATE pgbench_branches SET bbalance = bbalance + :delta WHERE bid = :bid; +INSERT INTO pgbench_history (tid, bid, aid, delta, mtime) VALUES (:tid, :bid, :aid, :delta, CURRENT_TIMESTAMP); +END; diff --git a/rest_api/scripts/scripts/test.sql b/rest_api/scripts/scripts/test.sql new file mode 100644 index 0000000..79dbcb4 --- /dev/null +++ b/rest_api/scripts/scripts/test.sql @@ -0,0 +1,11 @@ +\set aid random(1, 100000 * :scale) +\set bid random(1, 1 * :scale) +\set tid random(1, 10 * :scale) +\set delta random(-5000, 5000) +BEGIN; +UPDATE pgbench_accounts SET abalance = abalance + :delta WHERE aid = :aid; +SELECT abalance FROM pgbench_accounts WHERE aid = :aid; +UPDATE pgbench_tellers SET tbalance = tbalance + :delta WHERE tid = :tid; +UPDATE pgbench_branches SET bbalance = bbalance + :delta WHERE bid = :bid; +INSERT INTO pgbench_history (tid, bid, aid, delta, mtime) VALUES (:tid, :bid, :aid, :delta, CURRENT_TIMESTAMP); +END; diff --git a/rest_api/scripts/scripts/test_QqFoLgr.sql b/rest_api/scripts/scripts/test_QqFoLgr.sql new file mode 100644 index 0000000..79dbcb4 --- /dev/null +++ b/rest_api/scripts/scripts/test_QqFoLgr.sql @@ -0,0 +1,11 @@ +\set aid random(1, 100000 * :scale) +\set bid random(1, 1 * :scale) +\set tid random(1, 10 * :scale) +\set delta random(-5000, 5000) +BEGIN; +UPDATE pgbench_accounts SET abalance = abalance + :delta WHERE aid = :aid; +SELECT abalance FROM pgbench_accounts WHERE aid = :aid; +UPDATE pgbench_tellers SET tbalance = tbalance + :delta WHERE tid = :tid; +UPDATE pgbench_branches SET bbalance = bbalance + :delta WHERE bid = :bid; +INSERT INTO pgbench_history (tid, bid, aid, delta, mtime) VALUES (:tid, :bid, :aid, :delta, CURRENT_TIMESTAMP); +END; diff --git a/rest_api/scripts/scripts/test_UxQcfH6.sql b/rest_api/scripts/scripts/test_UxQcfH6.sql new file mode 100644 index 0000000..79dbcb4 --- /dev/null +++ b/rest_api/scripts/scripts/test_UxQcfH6.sql @@ -0,0 +1,11 @@ +\set aid random(1, 100000 * :scale) +\set bid random(1, 1 * :scale) +\set tid random(1, 10 * :scale) +\set delta random(-5000, 5000) +BEGIN; +UPDATE pgbench_accounts SET abalance = abalance + :delta WHERE aid = :aid; +SELECT abalance FROM pgbench_accounts WHERE aid = :aid; +UPDATE pgbench_tellers SET tbalance = tbalance + :delta WHERE tid = :tid; +UPDATE pgbench_branches SET bbalance = bbalance + :delta WHERE bid = :bid; +INSERT INTO pgbench_history (tid, bid, aid, delta, mtime) VALUES (:tid, :bid, :aid, :delta, CURRENT_TIMESTAMP); +END;