PostgreSQL Server Benchmarks: Part Two — Configuration

27 Feb 2011

Welcome to part two of my series on benchmarking Estately’s new database server. Back in Part One, I described the background of the project and outlined the hardware and methodology that I’ll be using. This post describes the baseline configuration of the server. I’ll show how I configured the BIOS, installed the OS, and set up the benchmarking tools.

You may be interested in the other parts of this series:

So without further ado…

BIOS

To begin with, I reset the BIOS to defaults:

I want to start my testing with software RAID, so I went into the SAS 6/iR and H800 BIOSes to break the existing RAID arrays. As I mentioned in Part One, I’m going to test both configs, but it’s just easier to start with software RAID.

Operating System

I installed 64-bit Ubuntu 10.04 LTS (aka Lucid Lynx) from the 10.04.1 installer CD, since I had one laying around. To keep things simple, I used the minimal install option (F4 at the installer’s bootloader and select “Install a minimal system”). I ran through the installer choosing defaults for nearly everything. I deviated in two places:

On first boot, there was a nasty surprise; for some reason it could load GRUB but not the root device. Thanks to this bug report and many similar mailing list threads and forum posts, I was able to solve it by tweaking my GRUB config. Specifically, I edited /etc/default/grub and changing the following line:

GRUB_CMDLINE_LINUX_DEFAULT="quiet"

… to …

GRUB_CMDLINE_LINUX_DEFAULT="rootdelay=50"

… and ran update-grub to install the new config. This fixed the problem and I could reliably reboot.

Once the system was up, I updated it to 10.04.2 and installed build-essential so I could compile the benchmarking tools:

# apt-get update
# apt-get dist-upgrade
# apt-get build-essential
# apt-get --purge autoremove
# reboot

This updated the kernel to 2.6.32-28-server, so I rebooted.

Software

Now that the OS was set up and stable, it was time to install some of the tools I’d be needing later. First up was Dell’s OpenManage storage tools, which will let me configure the RAID arrays from the OS. Fortunately, there is a community-supported apt repository you can use to install the necessary bits:

# echo 'deb http://linux.dell.com/repo/community/deb/latest /' > /etc/apt/source.list.d/dellomsa.list
# apt-get update
# apt-get install srvadmin-base srvadmin-storageservices srvadmin-idrac srvadmin-standardagent

Next up are our benchmarking tools. I downloaded and installed bonnie++, which was very straightforward:

$ wget http://www.coker.com.au/bonnie++/experimental/bonnie++-1.96.tgz
$ tar zxvf bonnie++-1.96.tgz
$ cd bonnie++-1.96
$ ./configure
$ make && sudo make install

Then sysbench, which was harder. I picked up the magic tip from here, which involves tweaking the autoconf setup:

$ sudo apt-get install automake
$ wget -O sysbench.tgz http://sourceforge.net/projects/sysbench/files/sysbench/0.4.12/sysbench-0.4.12.tar.gz/download
$ tar zxvf sysbench.tgz
$ cd sysbench-0.4.12
$ sed -i.bak 's/AC_PROG_LIBTOOL/AC_PROG_RANLIB/' configure.ac
$ ./autogen.sh
$ ./configure --without-mysql
$ make && sudo make install

Next, I fetched Greg Smith’s stream-scaling tools, installing git first:

$ sudo apt-get install git-core
$ git clone git://github.com/gregs1104/stream-scaling

Finally, PostgreSQL and pgbench. This required installing readline and zlib:

$ sudo apt-get install libreadline-dev zlib1g-dev
$ wget http://wwwmaster.postgresql.org/redir/198/h/source/v9.0.4/postgresql-9.0.4.tar.gz
$ tar zxvf postgresql-9.0.4.tar.gz
$ cd postgresql-9.0.4
$ ./configure
$ make && sudo make install
$ cd contrib/pgbench
$ make && sudo make install

With all that done, it was time to reboot.

Thanks, and Next Time on bleything.net…

A huge thanks to Jeremy Hinegardner (@copiousfreetime) and Scott M. Likens (@scottmlikens) for pointing out the Dell apt repository. I searched and searched and searched and never found it myself.

In Part Three, I’ll share the memory and CPU benchmarking techniques and results. Keep your eyes peeled!

« go back