From f138ba9ae252a621d116993135e4926beb88c624 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20tom=20W=C3=B6rden?= <henrik@trineo.org> Date: Fri, 28 May 2021 08:24:08 +0200 Subject: [PATCH] DOC: added docs on sql-profiling --- doc/devel/Benchmarking.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/doc/devel/Benchmarking.md b/doc/devel/Benchmarking.md index 3fa2c42c..9184b64a 100644 --- a/doc/devel/Benchmarking.md +++ b/doc/devel/Benchmarking.md @@ -32,6 +32,39 @@ A somewhat outdated script which executes a given query a number of times and th about the `TransactionBenchmark` readings (see below for more information about the transaction benchmarks) delivered by the server. + +### `sql_routine_measurement.py` + + + +Simply call `./sql_routine_measurement.py` in the scripts directory. An sql +file is automatically executed which enables the correct `performance_schema` +tables. However, the performance_schema of mariadb needs to be enabled. Add +`performance_schema=ON` to the configuration file of mariadb as it needs to be +enabled on start up. +This script expects the MariaDB server to be accessible on 127.0.0.1 with the default caosdb user +and password (caosdb;random1234). + +#### Preparing docker setup for this: +Change the docker-compose file to include the following for the mariadb service: +``` + networks: + # available on port 3306, host name 'sqldb' + - caosnet + ports: + - 3306:3306 +``` +Check it with `mysql -ucaosdb -prandom1234 -h127.0.0.1 caosdb` +Set the schema to `ON` in `profiles/empty/custom/mariadb.conf.d/mariadb.cnf` or in the profile that you use. +The `performance_schema` setting in the MariaDB server must be enabled, for example by setting +this in the config files: +``` +[mysqld] + +performance_schema=ON +``` +Start the server. + ### Benchmarking SQL commands ### MariaDB and MySQL have a feature to enable the logging of SQL queries' times. This logging must be -- GitLab