MARIADB-SLAP(1)
πΈ MARIADB-SLAP πΈ
okay so hi bestie π we're deep in the MariaDB Database System manual, section 1, and today's main character is mariadb-slap β¨
π NAME π
mariadb-slap β the load emulation client. and yes, the page literally says mariadb-slap is now a symlink to mariadb-slap π« iconic, no notes.
β¨ SYNOPSIS β¨
mariadb-slap [options]
π DESCRIPTION π
so mariadb-slap is a diagnostic program, and its whole thing is emulating client load against a MariaDB server and reporting the timing of every stage β±οΈ. it works exactly like a whole crowd of clients are all up in the server's business at the same time π«Ά.
you invoke it like this, bestie:
shell> mariadb-slap [options]
some options β like --create or --query β let you pass in a string containing an SQL statement, or a file containing statements. if you go the file route, by default it has to be one statement per line (that is, the implicit statement delimiter is the newline character, periodt). want something else? use --delimiter to pick a different delimiter, and then you can write statements that span multiple lines or stack multiple statements on a single line π
. oh and real talk: you cannot include comments in a file β mariadb-slap does not understand them π.
π the three stages π
mariadb-slap runs in three stages:
- Create schema, table, and optionally any stored programs or data you want to using for the test. This stage uses a single client connection.
- Run the load test. This stage can use many client connections.
- Clean up (disconnect, drop table if specified). This stage uses a single client connection.
π¦ examples π¦
one. supply your own create and query SQL statements, with 50 clients querying and 200 selects for each:
mariadb-slap --delimiter=";" \
--create="CREATE TABLE a (b int);INSERT INTO a VALUES (23)" \
--query="SELECT * FROM a" --concurrency=50 --iterations=200
two. let mariadb-slap build the query SQL statement with a table of two INT columns and three VARCHAR columns. use five clients querying 20 times each. do not create the table or insert the data (that is, use the previous test's schema and data):
mariadb-slap --concurrency=5 --iterations=20 \
--number-int-cols=2 --number-char-cols=3 \
--auto-generate-sql
three. tell the program to load the create, insert, and query SQL statements from the specified files, where the create.sql file has multiple table creation statements delimited by ; and multiple insert statements delimited by ;. the --query file will have multiple queries delimited by ;. run all the load statements, then run all the queries in the query file with five clients (five times each):
mariadb-slap --concurrency=5 \
--iterations=5 --query=query.sql --create=create.sql \
--delimiter=";"
okay now the fun part π mariadb-slap supports the following options, and you can drop them on the command line or in the [mariadb-slap] and [client] option file groups. mariadb-slap also supports the options for processing option files β¨.
--help,-?β display a help message and exit. the classic "what do I do" button π«Ά--auto-generate-sql,-aβ generate SQL statements automatically when they are not supplied in files or via command options. it just makes stuff up for you, slay β¨--auto-generate-sql-add-autoincrementβ add anAUTO_INCREMENTcolumn to automatically generated tables.--auto-generate-sql-execute-number=Nβ specify how many queries to generate automatically.--auto-generate-sql-guid-primaryβ add a GUID-based primary key to automatically generated tables.--auto-generate-sql-load-type=typeβ specify the test load type. the allowable values areread(scan tables),write(insert into tables),key(read primary keys),update(update primary keys), ormixed(half inserts, half scanning selects). the default ismixed.--auto-generate-sql-secondary-indexes=Nβ specify how many secondary indexes to add to automatically generated tables. by default, none are added.--auto-generate-sql-unique-query-number=Nβ how many different queries to generate for automatic tests. for example, if you run a key test that performs 1000 selects, you can use this option with a value of 1000 to run 1000 unique queries, or with a value of 50 to perform 50 different selects. the default is10.--auto-generate-sql-unique-write-number=Nβ how many different queries to generate for--auto-generate-sql-write-number. the default is10.--auto-generate-sql-write-number=Nβ how many row inserts to perform on each thread. the default is100.--commit=Nβ how many statements to execute before committing. the default is0(no commits are done).--compress,-Cβ compress all information sent between the client and the server, if both support compression.--concurrency=N,-c Nβ the number of clients to simulate when issuing theSELECTstatement.--create=valueβ the file or string containing the statement to use for creating the table.--create-schema=valueβ the schema in which to run the tests.--csv[=file_name]β generate output in comma-separated values format. the output goes to the named file, or to the standard output if no file is given.--debug[=debug_options],-# [debug_options]β write a debugging log. a typicaldebug_optionsstring is'd:t:o,file_name'. the default is'd:t:o,/tmp/mariadb-slap.trace'.--debug-checkβ print some debugging information when the program exits.--debug-info,-Tβ print debugging information and memory and CPU usage statistics when the program exits.--default-auth=nameβ default authentication client-side plugin to use.--defaults-extra-file=filenameβ setfilenameas the file to read default options from after the global defaults files has been read. must be given as first option.--defaults-file=filenameβ setfilenameas the file to read default options from, override global defaults files. must be given as first option.--delimiter=str,-F strβ the delimiter to use in SQL statements supplied in files or via command options.--detach=Nβ detach (close and reopen) each connection after eachNstatements. the default is0(connections are not detached).--engine=engine_name,-e engine_nameβ comma separated list of storage engines to use for creating the table. the test is run for each engine. you can also specify an option for an engine after a colon, for examplememory:max_row=2300. π§--host=host_name,-h host_nameβ connect to the MariaDB server on the given host.--init-command=strβ SQL Command to execute when connecting to MariaDB server. will automatically be re-executed when reconnecting.--iterations=N,-i Nβ the number of times to run the tests.--no-defaultsβ do not read default options from any option file. this must be given as the first argument.--no-dropβ do not drop any schema created during the test after the test is complete.--number-char-cols=N,-x Nβ the number ofVARCHARcolumns to use if--auto-generate-sqlis specified.--number-int-cols=N,-y Nβ the number ofINTcolumns to use if--auto-generate-sqlis specified.--number-of-queries=Nβ limit each client to approximately this many queries. query counting takes into account the statement delimiter. for example, if you invokemariadb-slapas follows, the;delimiter is recognized so that each instance of the query string counts as two queries. as a result, 5 rows (not 10) are inserted:
shell> mariadb-slap --delimiter=";" --number-of-queries=10
--query="use test;insert into t values(null)"
--only-printβ do not connect to databases.mariadb-slaponly prints what it would have done. pure imagination β¨--password[=password],-p[password]β the password to use when connecting to the server. if you use the short option form (-p), you cannot have a space between the option and the password. if you omit the password value following the--passwordor-poption on the command line,mariadb-slapprompts for one.
specifying a password on the command line should be considered insecure. you can use an option file to avoid giving the password on the command line π
--pipe,-Wβ on Windows, connect to the server via a named pipe. this option applies only if the server supports named-pipe connections.--plugin-dir=dir_nameβ directory for client-side plugins.--port=port_num,-P port_numβ the TCP/IP port number to use for the connection. forces--protocol=tcpwhen specified on the command line without other connection properties.--post-query=valueβ the file or string containing the statement to execute after the tests have completed. this execution is not counted for timing purposes.--post-system=strβ the string to execute viasystem()after the tests have completed. this execution is not counted for timing purposes.--pre-query=valueβ the file or string containing the statement to execute before running the tests. this execution is not counted for timing purposes.--pre-system=strβ the string to execute viasystem()before running the tests. this execution is not counted for timing purposes.--print-defaultsβ print the program argument list and exit. this must be given as the first argument.--protocol={TCP|SOCKET|PIPE|MEMORY}β the connection protocol to use for connecting to the server. it is useful when the other connection parameters normally would cause a protocol to be used other than the one you want. iykyk π--query=value,-q valueβ the file or string containing theSELECTstatement to use for retrieving data.--shared-memory-base-name=nameβ on Windows, the shared-memory name to use, for connections made via shared memory to a local server. this option applies only if the server supports shared-memory connections.--silent,-sβ silent mode. no output. shhh π€«--socket=path,-S pathβ for connections to localhost, the Unix socket file to use, or, on Windows, the name of the named pipe to use. forces--protocol=socketwhen specified on the command line without other connection properties; on Windows, forces--protocol=pipe.--sslβ enable SSL for connection (automatically enabled with other flags). disable with--skip-ssl.--ssl-ca=nameβ CA file in PEM format (check OpenSSL docs, implies--ssl).--ssl-capath=name- CA directory β check the OpenSSL docs for the deets, and heads up, this one implies
--ssl. π --ssl-cert=nameβ the X509 cert, in PEM format (check the OpenSSL docs, implies--ssl).--ssl-cipher=nameβ which SSL cipher to use (check the OpenSSL docs, implies--ssl).--ssl-key=nameβ the X509 key, in PEM format (check the OpenSSL docs, implies--ssl).--ssl-crl=nameβ certificate revocation list (check the OpenSSL docs, implies--ssl).--ssl-crlpath=nameβ certificate revocation list path (check the OpenSSL docs, implies--ssl).--ssl-verify-server-certβ verifies the server's "Common Name" in its cert against the hostname you used when connecting. Lowkey important and it is disabled by default, so if you want it, you gotta ask for it bestie. π--user=user_name,-u user_nameβ the MariaDB user name to use when connecting to the server. it's giving "who am i today". π--verbose,-vβ verbose mode, aka it prints more info about what the program is doing. You can stack this option multiple times to keep upping the amount of info. the way it just keeps yapping (affectionate). π₯--version,-Vβ display version information and exit. that's it, that's the whole job, and honestly? slay. β¨
π COPYRIGHT π
Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2025 MariaDB Foundation
This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
This documentation is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. (no cap, that's the actual legal vibe π«Ά)
You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA or see http://www.gnu.org/licenses/.
π SEE ALSO π
For more information, please refer to the MariaDB Documentation, available online at https://mariadb.com/docs/
πΈ AUTHOR πΈ
MariaDB Foundation (http://www.mariadb.org/).
and that's the whole page, bestie π this was MariaDB 11.8, dated 5 March 2025, filed under MARIADB-SLAP(1) β go forth and slay your connections π β¨
π¦ where this page comes from
- alpine 3.24: mariadb-doc 11.8.9-r0 Β· GPL-2.0-only
- arch rolling: mariadb-clients 13.0.2-2 Β· GPL-2.0-only
- arch rolling: mariadb-lts-clients 12.3.3-2 Β· GPL-2.0-only
- centos-stream 10: mariadb11.8 3:11.8.8-1.el10 Β· ( GPL-2.0-only OR Apache-2.0 ) AND ( GPL-2.0-or-later OR Apache-2.0 ) AND BSD-2-Clause AND BSD-3-Clause AND CC-BY-4.0 AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND ( GPL-3.0-or-later WITH Bison-exception-2.2 ) AND LGPL-2.0-only AND LGPL-2.0-or-later AND LGPL-2.1-only AND LGPL-2.1-or-later AND OpenSSL AND MIT AND OFL-1.1 AND CC0-1.0 AND PHP-3.0 AND PHP-3.01 AND zlib AND dtoa AND FSFAP AND blessing AND Info-ZIP AND Boehm-GC
- centos-stream 9: mariadb 3:11.8.8-1.module_el9+1370+ec5ecc2e Β· ( GPL-2.0-only OR Apache-2.0 ) AND ( GPL-2.0-or-later OR Apache-2.0 ) AND BSD-2-Clause AND BSD-3-Clause AND CC-BY-4.0 AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND ( GPL-3.0-or-later WITH Bison-exception-2.2 ) AND LGPL-2.0-only AND LGPL-2.0-or-later AND LGPL-2.1-only AND LGPL-2.1-or-later AND OpenSSL AND MIT AND OFL-1.1 AND CC0-1.0 AND PHP-3.0 AND PHP-3.01 AND zlib AND dtoa AND FSFAP AND blessing AND Info-ZIP AND Boehm-GC
- debian trixie: mariadb-client-compat 1:11.8.6-0+deb13u1 Β· GPL-2.0-only
- fedora 43: mariadb11.8 3:11.8.8-1.fc43 Β· ( GPL-2.0-only OR Apache-2.0 ) AND ( GPL-2.0-or-later OR Apache-2.0 ) AND BSD-2-Clause AND BSD-3-Clause AND CC-BY-4.0 AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND ( GPL-3.0-or-later WITH Bison-exception-2.2 ) AND LGPL-2.0-only AND LGPL-2.0-or-later AND LGPL-2.1-only AND LGPL-2.1-or-later AND OpenSSL AND MIT AND OFL-1.1 AND CC0-1.0 AND PHP-3.0 AND PHP-3.01 AND zlib AND dtoa AND FSFAP AND blessing AND Info-ZIP AND Boehm-GC
- fedora 43: mariadb12.3 3:12.3.2-2.fc43 Β· ( GPL-2.0-only OR Apache-2.0 ) AND ( GPL-2.0-or-later OR Apache-2.0 ) AND BSD-2-Clause AND BSD-3-Clause AND CC-BY-4.0 AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND ( GPL-3.0-or-later WITH Bison-exception-2.2 ) AND LGPL-2.0-only AND LGPL-2.0-or-later AND LGPL-2.1-only AND LGPL-2.1-or-later AND OpenSSL AND MIT AND OFL-1.1 AND CC0-1.0 AND PHP-3.0 AND PHP-3.01 AND zlib AND dtoa AND FSFAP AND blessing AND Info-ZIP AND Boehm-GC
- fedora 44: mariadb 3:11.8.6-2.fc44 Β· ( GPL-2.0-only OR Apache-2.0 ) AND ( GPL-2.0-or-later OR Apache-2.0 ) AND BSD-2-Clause AND BSD-3-Clause AND CC-BY-4.0 AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND ( GPL-3.0-or-later WITH Bison-exception-2.2 ) AND LGPL-2.0-only AND LGPL-2.0-or-later AND LGPL-2.1-only AND LGPL-2.1-or-later AND OpenSSL AND MIT AND OFL-1.1 AND CC0-1.0 AND PHP-3.0 AND PHP-3.01 AND zlib AND dtoa AND FSFAP AND blessing AND Info-ZIP AND Boehm-GC
- fedora 44: mariadb 3:11.8.8-3.fc44 Β· ( GPL-2.0-only OR Apache-2.0 ) AND ( GPL-2.0-or-later OR Apache-2.0 ) AND BSD-2-Clause AND BSD-3-Clause AND CC-BY-4.0 AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND ( GPL-3.0-or-later WITH Bison-exception-2.2 ) AND LGPL-2.0-only AND LGPL-2.0-or-later AND LGPL-2.1-only AND LGPL-2.1-or-later AND OpenSSL AND MIT AND OFL-1.1 AND CC0-1.0 AND PHP-3.0 AND PHP-3.01 AND zlib AND dtoa AND FSFAP AND blessing AND Info-ZIP AND Boehm-GC
- fedora 44: mariadb12.3 3:12.3.2-2.fc44 Β· ( GPL-2.0-only OR Apache-2.0 ) AND ( GPL-2.0-or-later OR Apache-2.0 ) AND BSD-2-Clause AND BSD-3-Clause AND CC-BY-4.0 AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND ( GPL-3.0-or-later WITH Bison-exception-2.2 ) AND LGPL-2.0-only AND LGPL-2.0-or-later AND LGPL-2.1-only AND LGPL-2.1-or-later AND OpenSSL AND MIT AND OFL-1.1 AND CC0-1.0 AND PHP-3.0 AND PHP-3.01 AND zlib AND dtoa AND FSFAP AND blessing AND Info-ZIP AND Boehm-GC
- nixpkgs unstable: mariadb-server 11.8.8
- opensuse-leap 16.0: mariadb-bench 11.8.8-160000.1.1 Β· SUSE-GPL-2.0-with-FLOSS-exception
- opensuse-leap 16.0: mariadb-bench 11.8.8-160000.1.1 Β· SUSE-GPL-2.0-with-FLOSS-exception
- opensuse-leap 16.0: mariadb-bench 11.8.8-160000.1.1 Β· SUSE-GPL-2.0-with-FLOSS-exception
- opensuse-leap 16.0: mariadb-bench 11.8.8-160000.1.1 Β· SUSE-GPL-2.0-with-FLOSS-exception
- ubuntu resolute: mariadb-client-compat 1:11.8.6-5 Β· GPL-2.0-only
- ubuntu resolute: mariadb-client-compat 1:11.8.6-5ubuntu0.1 Β· GPL-2.0-only
- ubuntu stonking: mariadb-client-compat 1:11.8.9+ds-4ubuntu2 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms