1MARIADB-SLAP(1)             MariaDB Database System            MARIADB-SLAP(1)
2
3
4

NAME

6       mariadb-slap - load emulation client (mysqlslap is now a symlink to
7       mariadb-slap)
8

SYNOPSIS

10       mysqlslap [options]
11

DESCRIPTION

13       mysqlslap is a diagnostic program designed to emulate client load for a
14       MariaDB server and to report the timing of each stage. It works as if
15       multiple clients are accessing the server.
16
17       Invoke mysqlslap like this:
18
19           shell> mysqlslap [options]
20
21       Some options such as --create or --query enable you to specify a string
22       containing an SQL statement or a file containing statements. If you
23       specify a file, by default it must contain one statement per line.
24       (That is, the implicit statement delimiter is the newline character.)
25       Use the --delimiter option to specify a different delimiter, which
26       enables you to specify statements that span multiple lines or place
27       multiple statements on a single line. You cannot include comments in a
28       file; mysqlslap does not understand them.
29
30       mysqlslap runs in three stages:
31
32        1. Create schema, table, and optionally any stored programs or data
33           you want to using for the test. This stage uses a single client
34           connection.
35
36        2. Run the load test. This stage can use many client connections.
37
38        3. Clean up (disconnect, drop table if specified). This stage uses a
39           single client connection.
40
41       Examples:
42
43       Supply your own create and query SQL statements, with 50 clients
44       querying and 200 selects for each:
45
46           mysqlslap --delimiter=";" \
47             --create="CREATE TABLE a (b int);INSERT INTO a VALUES (23)" \
48             --query="SELECT * FROM a" --concurrency=50 --iterations=200
49
50       Let mysqlslap build the query SQL statement with a table of two INT
51       columns and three VARCHAR columns. Use five clients querying 20 times
52       each. Do not create the table or insert the data (that is, use the
53       previous test´s schema and data):
54
55           mysqlslap --concurrency=5 --iterations=20 \
56             --number-int-cols=2 --number-char-cols=3 \
57             --auto-generate-sql
58
59       Tell the program to load the create, insert, and query SQL statements
60       from the specified files, where the create.sql file has multiple table
61       creation statements delimited by ´;´ and multiple insert statements
62       delimited by ´;´. The --query file will have multiple queries delimited
63       by ´;´. Run all the load statements, then run all the queries in the
64       query file with five clients (five times each):
65
66           mysqlslap --concurrency=5 \
67             --iterations=5 --query=query.sql --create=create.sql \
68             --delimiter=";"
69
70       mysqlslap supports the following options, which can be specified on the
71       command line or in the [mysqlslap] and [client] option file groups.
72       mysqlslap also supports the options for processing option files.
73
74--help, -?
75
76           Display a help message and exit.
77
78--auto-generate-sql, -a
79
80           Generate SQL statements automatically when they are not supplied in
81           files or via command options.
82
83--auto-generate-sql-add-autoincrement
84
85           Add an AUTO_INCREMENT column to automatically generated tables.
86
87--auto-generate-sql-execute-number=N
88
89           Specify how many queries to generate automatically.
90
91--auto-generate-sql-guid-primary
92
93           Add a GUID-based primary key to automatically generated tables.
94
95--auto-generate-sql-load-type=type
96
97           Specify the test load type. The allowable values are read (scan
98           tables), write (insert into tables), key (read primary keys),
99           update (update primary keys), or mixed (half inserts, half scanning
100           selects). The default is mixed.
101
102--auto-generate-sql-secondary-indexes=N
103
104           Specify how many secondary indexes to add to automatically
105           generated tables. By default, none are added.
106
107--auto-generate-sql-unique-query-number=N
108
109           How many different queries to generate for automatic tests. For
110           example, if you run a key test that performs 1000 selects, you can
111           use this option with a value of 1000 to run 1000 unique queries, or
112           with a value of 50 to perform 50 different selects. The default is
113           10.
114
115--auto-generate-sql-unique-write-number=N
116
117           How many different queries to generate for
118           --auto-generate-sql-write-number. The default is 10.
119
120--auto-generate-sql-write-number=N
121
122           How many row inserts to perform on each thread. The default is 100.
123
124--commit=N
125
126           How many statements to execute before committing. The default is 0
127           (no commits are done).
128
129--compress, -C
130
131           Compress all information sent between the client and the server if
132           both support compression.
133
134--concurrency=N, -c N
135
136           The number of clients to simulate when issuing the SELECT
137           statement.
138
139--create=value
140
141           The file or string containing the statement to use for creating the
142           table.
143
144--create-schema=value
145
146           The schema in which to run the tests.
147
148--csv[=file_name]
149
150           Generate output in comma-separated values format. The output goes
151           to the named file, or to the standard output if no file is given.
152
153--debug[=debug_options], -# [debug_options]
154
155           Write a debugging log. A typical debug_options string is
156           ´d:t:o,file_name´. The default is ´d:t:o,/tmp/mysqlslap.trace´.
157
158--debug-check
159
160           Print some debugging information when the program exits.
161
162--debug-info, -T
163
164           Print debugging information and memory and CPU usage statistics
165           when the program exits.
166
167--default-auth=name
168
169           Default authentication client-side plugin to use.
170
171--defaults-extra-file=filename
172
173           Set filename as the file to read default options from after the
174           global defaults files has been read.  Must be given as first
175           option.
176
177--defaults-file=filename
178
179           Set filename as the file to read default options from, override
180           global defaults files.  Must be given as first option.
181
182--delimiter=str, -F str
183
184           The delimiter to use in SQL statements supplied in files or via
185           command options.
186
187--detach=N
188
189           Detach (close and reopen) each connection after each N statements.
190           The default is 0 (connections are not detached).
191
192--engine=engine_name, -e engine_name
193
194           Comma separated list of storage engines to use for creating the
195           table. The test is run for each engine. You can also specify an
196           option for an engine after a colon, for example
197           memory:max_row=2300.
198
199--host=host_name, -h host_name
200
201           Connect to the MariaDB server on the given host.
202
203--init-command=str
204
205           SQL Command to execute when connecting to MariaDB server. Will
206           automatically be re-executed when reconnecting.
207
208--iterations=N, -i N
209
210           The number of times to run the tests.
211
212--no-defaults
213
214           Do not read default options from any option file. This must be
215           given as the first argument.
216
217--no-drop
218
219           Do not drop any schema created during the test after the test is
220           complete.
221
222--number-char-cols=N, -x N
223
224           The number of VARCHAR columns to use if --auto-generate-sql is
225           specified.
226
227--number-int-cols=N, -y N
228
229           The number of INT columns to use if --auto-generate-sql is
230           specified.
231
232--number-of-queries=N
233
234           Limit each client to approximately this many queries. Query
235           counting takes into account the statement delimiter. For example,
236           if you invoke mysqlslap as follows, the ; delimiter is recognized
237           so that each instance of the query string counts as two queries. As
238           a result, 5 rows (not 10) are inserted.
239
240               shell> mysqlslap --delimiter=";" --number-of-queries=10
241                        --query="use test;insert into t values(null)"
242
243--only-print
244
245           Do not connect to databases.  mysqlslap only prints what it would
246           have done.
247
248--password[=password], -p[password]
249
250           The password to use when connecting to the server. If you use the
251           short option form (-p), you cannot have a space between the option
252           and the password. If you omit the password value following the
253           --password or -p option on the command line, mysqlslap prompts for
254           one.
255
256           Specifying a password on the command line should be considered
257           insecure. You can use an option file to avoid giving the password
258           on the command line.
259
260--pipe, -W
261
262           On Windows, connect to the server via a named pipe. This option
263           applies only if the server supports named-pipe connections.
264
265--plugin-dir=dir_name
266
267           Directory for client-side plugins.
268
269--port=port_num, -P port_num
270
271           The TCP/IP port number to use for the connection.
272
273--post-query=value
274
275           The file or string containing the statement to execute after the
276           tests have completed. This execution is not counted for timing
277           purposes.
278
279--post-system=str
280
281           The string to execute via system() after the tests have completed.
282           This execution is not counted for timing purposes.
283
284--pre-query=value
285
286           The file or string containing the statement to execute before
287           running the tests. This execution is not counted for timing
288           purposes.
289
290--pre-system=str
291
292           The string to execute via system() before running the tests. This
293           execution is not counted for timing purposes.
294
295--print-defaults
296
297           Print the program argument list and exit.  This must be given as
298           the first argument.
299
300--protocol={TCP|SOCKET|PIPE|MEMORY}
301
302           The connection protocol to use for connecting to the server. It is
303           useful when the other connection parameters normally would cause a
304           protocol to be used other than the one you want.
305
306--query=value, -q value
307
308           The file or string containing the SELECT statement to use for
309           retrieving data.
310
311--shared-memory-base-name=name
312
313           On Windows, the shared-memory name to use, for connections made via
314           shared memory to a local server. This option applies only if the
315           server supports shared-memory connections.
316
317--silent, -s
318
319           Silent mode. No output.
320
321--socket=path, -S path
322
323           For connections to localhost, the Unix socket file to use, or, on
324           Windows, the name of the named pipe to use.
325
326--ssl
327
328           Enable SSL for connection (automatically enabled with other flags).
329           Disable with --skip-ssl.
330
331--ssl-ca=name
332
333           CA file in PEM format (check OpenSSL docs, implies --ssl).
334
335--ssl-capath=name
336
337           CA directory (check OpenSSL docs, implies --ssl).
338
339--ssl-cert=name
340
341           X509 cert in PEM format (check OpenSSL docs, implies --ssl).
342
343--ssl-cipher=name
344
345           SSL cipher to use (check OpenSSL docs, implies --ssl).
346
347--ssl-key=name
348
349           X509 key in PEM format (check OpenSSL docs, implies --ssl).
350
351--ssl-crl=name
352
353           Certificate revocation list (check OpenSSL docs, implies --ssl).
354
355--ssl-crlpath=name
356
357           Certificate revocation list path (check OpenSSL docs, implies
358           --ssl).
359
360--ssl-verify-server-cert
361
362           Verify server's "Common Name" in its cert against hostname used
363           when connecting. This option is disabled by default.
364
365--user=user_name, -u user_name
366
367           The MariaDB user name to use when connecting to the server.
368
369--verbose, -v
370
371           Verbose mode. Print more information about what the program does.
372           This option can be used multiple times to increase the amount of
373           information.
374
375--version, -V
376
377           Display version information and exit.
378
380       Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc.,
381       2010-2019 MariaDB Foundation
382
383       This documentation is free software; you can redistribute it and/or
384       modify it only under the terms of the GNU General Public License as
385       published by the Free Software Foundation; version 2 of the License.
386
387       This documentation is distributed in the hope that it will be useful,
388       but WITHOUT ANY WARRANTY; without even the implied warranty of
389       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
390       General Public License for more details.
391
392       You should have received a copy of the GNU General Public License along
393       with the program; if not, write to the Free Software Foundation, Inc.,
394       51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA or see
395       http://www.gnu.org/licenses/.
396
397

SEE ALSO

399       For more information, please refer to the MariaDB Knowledge Base,
400       available online at https://mariadb.com/kb/
401

AUTHOR

403       MariaDB Foundation (http://www.mariadb.org/).
404
405
406
407MariaDB 10.5                     27 June 2019                  MARIADB-SLAP(1)
Impressum