Month: September 2011

IOps calculations

So I got a disk array and I want to know what sort of IOps workload it can support.

Articles like IOps? provide a pretty standard formula I have seen before, but only answers the question “Given a required workload IOps for an application, how big does the array need to be to support it?” This equation is

Array IOPS = (Workload IOPS * Read Workload Percent) + (Workload IOPS * Write Workload Percent * RAID IO Penalty)

However, sometimes you want to answer the opposite question “Given a total number of IOps for an array, how much workload IOps can it support?”

The answer is really just to solve for Workload IOPS in the above equation. To save you the math,

Workload IOPS = Array IOPS / (Read Workload Percent + Write Workload Percent * RAID IO Penalty)

This could have been pretty handy a couple of years ago when I was trying to build a private cloud, to help me understand how much workload the arrays we used would support  – and therefore figure out how many virtual machines we could run.


Henplus with Java-Readline for OS X

UPDATE: The procedure below is not entirely correct. It will work, but its not the most straight forward, and it probably won’t get you what you are really looking for. I have written a new procedure for building Java-Readline and GNU readline for OS X. Please use these instructions instead.


So, I found it time to revisit an old friend, HenPlus since I’ve been mucking around in a few databases lately.

The wrinkle this time, OS X. The main problem being the JNI interface to the GNU Readline library Java-Readline does not compile all that well on OS X.

Doing a bit of searching I found a few articles describing the steps to compile it, but they are slightly out of date for OS X 10.7 Lion, so I figured I’d put in my two cents.

For starters, Nathan Toone’s article Java-Readline on Mac OS X Update gets pretty close, but things have changed since he wrote it in 2006. So here’s my redux based on it.

Note that in my case, I did not care about building a universal binary (if that’s even possible on Lion) so I didn’t have to make as many changes as he did.

Tweaking Java-Readline


In the source root, edit Makefile and make the following changes:

  • Below the line # Operating system dependent
    Add JAVA_HOME = `/usr/libexec/java_home`
  • Clear out the JAVANATINC variable
  • Change the JAVAINCLUDE variable
    to /System/Library/Frameworks/JavaVM.framework/Headers
    (This is needed to find jni.h)

Next, edit src/native/Makefileand change the following:

  • Clear out the LIBPATH variable
  • Change the CFLAGS to -fno-common -DMAC_OS
  • Change $(CC) -shared (OBJECTS) $(LIBPATH) $($(TG)_LIBS) -o $@ to
    $(CC) -bundle -flat_namespace $(OBJECTS) $(LIBPATH) $($(TG)_LIBS) -o $@
  • Change the JavaReadline_LIBS variable to be -lreadline -ltermcap

Now, you need to edit src/native/org_gnu_readline_Readline.cand make the following changes:

  • On lines 98, 114, 213, and 224,
    change #ifdef JavaReadline to #if defined JavaReadline && !defined MAC_OS
  • On lines 216, 235, and 475,
    change #ifdef JavaEditline to #if defined JavaEditline || defined MAC_OS

Now, you can run make, and you will end up with and libreadline-java.jar.

Rename to libJavaReadline.jnilib.

I’ve made a patch script of all the changes to save anyone some effort in editing all the files by hand. Simply run

  • patch -p1 < libreadline-java-0.8.0-osx.patch

HenPlus Notes

Once you have compiled Java-Readline, you can compile HenPlus as described. A couple of things to note though

  • Copy libreadline-java.jar from Java-Readline into <INSTALLDIR>/share/henplus
  • Make <INSTALLDIR>/lib and copy libJavaReadline.jnilib into it
  • Change all occurrences of LD_LIBRARY_PATH in bin/henplus to DYLD_LIBRARY_PATH

And from there you should be set.