Installing Q4M

To install Q4M, download either our source distribution or a binary distribution. Binary distribution is only available for Linux i386 or x86-64 platforms. The source distribution would work on Solaris >=8 or Mac OS X as well.
q4m-0.5.1.tar.gz (source)
q4m-0.5.1-linux-i386-fast-mutexes.tar.gz (linux; i386)
q4m-0.5.1-linux-i386-no-fast-mutexes.tar.gz (linux; i386)
SVN repository of Q4M can be found at http://kazuho.31tools.com/svn/q4m/.

Installing the Source Distribution

For installing the source distribution, source code of MySQL is required.
  1. download and build MySQL 5.1 (installation is not mandatory, but if you plan to install Q4M into a binary distribution of MySQL, make sure to use the same configuration options for building the MySQL source distribution. The configuration of MySQL can be found in bin/mysqlbug script.)
  2. untar the Q4M distribution
  3. run configure
  4. run make
  5. run make install
  6. run support-files/install.sql
Below are the important options when configuring Q4M.
--with-mysql=mysql-source-dir
set the directory of MySQL source code (required)
--prefix=mysql-dir
set the directory under which MySQL 5.1 is installed (optional)
--with-debug
if your MySQL is built with --with-debug option, Q4M should be built with this option as well. Or your MySQL server will crash. (optional)
--with-sync=yes|no|fsync|fcntl
select disk flush method. The fcntl option only works on Mac OS X, which calls fcntl with F_FULLFSYNC option. (optional)

Installing the Binary Distribution

Follow the steps below to install the binary distribution.
  1. Choose the right distribution to install. If your MySQL installation was compiled with --with-fast-mutexes option set, download q4m-0.5.1-linux-i386-fast-mutexes.tar.gz, or otherwise, download q4m-0.5.1-linux-i386-no-fast-mutexes.tar.gz. Configuration options of an already-installed MySQL server can be found in the bin/mysqlbug script.
  2. untar the distribution
  3. copy support-files/q4m-forward to bin directory of MySQL
  4. copy libqueue_engine.so to lib/mysql/plugin directory of MySQL (or to lib/mysql directory if mysql<=5.1.23)
  5. run support-files/install.sql

Testing the Installation

To test your installation, run the run_tests.pl. You can set your database location by using the DBI environment variable. DBI_USER and DBI_PASSWORD variables are also avialable. An output like below should appear.
$ DBI='dbi:mysql:database=test;host=kazdev;port=3307' ./run_tests.pl
t/01-base................ok
t/02-queue...............ok
t/03-queue-error-wait....ok
t/03-queue-error.........ok
t/04-blob................ok
t/05-multireader.........

Multireader benchmark result:
    Number of messages: 6400
    Number of readers:  32
    Elapsed:            3.366 seconds
    Throughput:         1901.245 mess./sec.

t/05-multireader.........ok
All tests successful.
Files=6, Tests=5370, 140 wallclock secs (115.80 cusr +  5.92 csys = 121.72 CPU)
$