diff --git a/doc/devel/Benchmarking.md b/doc/devel/Benchmarking.md index 3fa2c42c65d613844baf7b3011687605ad5763ac..9184b64a9e7769fa3671e921f44583d962930b3d 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