Patrick Galbraith (capttofu) wrote,
Patrick Galbraith

SQL Bench as a separate project , released

I'm pleased to announce the release of SQL Bench, the benchmark test suite the comes standard with MySQL, now as a separate project targeted for testing any database. I have pulled it out as a separate project so I can modify and improve it faster. With this release, I have successfully used it for testing both Drizzle and MySQL. Other RDBMSs, I have yet to test.


I modified the connection test, which part of it is to connect, run a single query for one row, disconnect, to iterate only 20,000 times vs. 100,000 times. The reason for this is to allow this test to reasonably test databases that use TCP sockets. When I added Drizzle support to SQL Bench, upon running the connect test it would fail inexplicably. After some serious testing, it was realized that since Drizzle uses TCP sockets, even when connecting to localhost, that the connect test would fail because of the result of sockets being kept around in the kernel in the TIME_WAIT state so any extra TCP packets can be flushed out. The 28000 is the default port range available for socket connections.

Eric Day found this by looking:

# cat /proc/sys/net/ipv4/tcp_fin_timeout

# cat /proc/sys/net/ipv4/ip_local_port_range
32768 61000

61000-32768= 28232

So, the test would fail at 28232 connect/query/disconnect-s. This would work find in MySQL using UNIX domain sockets but as soon as I switched to TCP, it would fail. To be certain, I wrote the tests for both RDBMSs in C using the native libraries versus DBD drivers. So, hence this 28k number where it would fail was explained.

Another thing to point out is that the Perl driver for Drizzle, DBD::drizzle has some small bug as well that allows a duplicate key insert to not throw an error, but that is the driver, not sql-bench or the database server itself.

For now, feel free to have fun with SQL Bench!

The Bazaar repo is at:
Tags: drizzle, mysql, sql-bench, testing
  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic