Tony Bourke

Site Map

Links

Load Balancing Resources:

Database Resources

Super Smack FAQ

Q: Does Super Smack use persistent database connections

A: I was recently asked this question, but I didn't know the answer. I'd assumed that Super Smack does indeed use persistent database connections, but I wasn't sure. Here's how to find out for sure.

The application mysqladmin allows you to gather a multitude of stats by giving it the option extended-status, which is the same as doing a SHOW STATUS in mysql.

One of those stats is called "Connections", which shows the number of database connections since the server (re)started. The metric is known as a counter, which means everytime a new DB connection is made, the counter increments by one.

A typical run of Super Smack will generate thousands of queries, so if Super Smack doesn't use persistent connections, the counter should be incremented thousands of times after a Super Smack run. If Super Smack does use persistent connections, the "Connections" counter should only increment by the number of clients specified in the Super Smack options (number of clients +1 actually, since running mysqladmin extended-status uses a database connection itself).

I did a test run with 200,000 queries and 10 clients, and the "Connection" counter only increased by 10.

So the answer is yes, Super Smack does use persistent database connections

Q: Super Smack can't find libmysqlclient even though it's looking in the right place on my 64-bit Operating System (Linux on AMD64, for instance)

A: If the ./configure script can't find libmysqlclient.so even though it's looking in the right place and the file exists, it's likely because you're trying to build a 64-bit binary and the libmysqlclient that it's looking at is 32-bit.

When building a 64-bit binary, any libraries that it uses also need to be 64-bit. Under Fedora 64-bit edition, those 64-bit libraries are stored in /usr/lib64. Solaris and other operating systems that exist in both 32-bit and 64-bit mode also have separate directories for 32-bit and 64-bit libraries.

The solution in the case of a question I recently recieved was to point Super Smack to looking /usr/lib64/mysql for libmysqlclient.so with the option --with-mysql-lib=/usr/lib64

Alternatively, you can build a 32-bit binary instead. There's no advantage for bulding Super Smack as a 64-bit binary. The two main advantages to running 64-bit binaries is access to large amounts of memory, and 64-bit math. Super Smack doesn't use much memory, and it doesn't take advantage of 64-bit arithmatic, so there's no benfit.

To tell GCC to build a 32-bit binary, give -m32 as a CLFAG compile option.