Brian "Krow" Aker (krow) wrote,
Brian "Krow" Aker

mysqlslap, next version...

Since I need to write up what I added for the next version of
mysqlslap (aka... this is not what is in 5.1...), I thought I would
blog it :)

The current genesis of additions come either from user requests or...
well my own use :)

The last couple of weeks have had me spending time looking at
performance problems so I've found the need for all sorts of new
pieces. Some were just a couple of lines of code, some where many

Ignore SQL errors during the query run. By default errors shut down
slap. If you get errors, you have problems. Sometimes though, you
want to keep going...

Final Output
Standard deviation is now calculated and displayed (N-1). I had
visually observed a while ago that when variance goes up, engines
tend to behave wildly. Its a good rule of thumb for telling how far
you can scale an engine. Total time for test is now displayed and the
time it took to load the initial data is displayed. Slap also gives
the count for the total number of queries needed to generate the
initial data.

You can now control the label used in the CSV output. Need to name
your test runs? You can now do this instead of just accepting the
standard "write", "read", etc...

Specify the fields used in SELECT queries in the test. I am using
this currently to determine blob behavior when selected/not selected
in rows.

Added --number-blob-cols for auto generated SQL. Syntax is such:

Gives you 3 blobs.


Will give you three blobs with a size of 2K


Would give you 3 blobs with a random size between 1024 and 2048.

I think this feature should be called the "Omer" feature, since Omer
asked for this the first time he saw slap. The feature tells slap to
run a series of queries for a specified time. Most of the features I
am listing here took me all of 20 minutes or less to write. This one
took a little bit of thought (not much...). Time is in seconds.

Delay the start of the executing threads by a period of time no
greater then what is specified (in microseconds). Nice little trick
for creating chaotic patterns in the tests.

Run mysqlslap forever on the tests you specified. I've been using
this to make sure new features in the MySQL Server really do work.

There is a remote chance I am going to look into adding a feature
that will allow you to mix the current auto tests together in the
next couple of weeks. I have an idea on how to do the syntax, I just
now need to find the time to do it. I have a flight to Japan
tomorrow, so who knows what I may do :)

In the long range feature list I am starting to think of a scripting
language for slap, or some sort of configuration file. One of my
coworkers in PS was asking about this and I am beginning to think of
ways to do it (anyone have thoughts on using JSON as syntax?). I am
also thinking about creating a top like interface so that I can see
data as it is being generated. Stewart has asked about multi-host
support for thrashing NDB. Creating an internal scoreboard of ongoing
work would allow me to do more with statistics. A plugin system for
data generators and query generators would be nice (this assumes
people would write them...).

Oh, and I got a request for PostgreSQL support :)

Recent Posts from This Journal

  • Post a new comment


    Comments allowed for friends only

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded