Raspberry Pi Vs TDI

After waiting almost 14 weeks, my Raspberry Pi Model B finally arrived in the mail. I rushed down to the local Office Works, picked up a cheap SD card and a micro-USB charger, and then proceeded to download and install Raspbian; the Debian based distribution optimized for the Raspberry Pi. After some fiddling with the clear-case, and a lot of finger crossing, the machine booted up. So, now what?

When the Raspberry PI hit the shelves, one of things that I got really excited about was seeing it running WebSphere Application Server V8.5. Simone Maple put up a post showing a Raspberry PI running the new Liberty Profile. So it got me thinking; if it can run Websphere, can it run Tivoli Directory Integrator? TDI is a Java based integration product for quickly writing programs to move data from one point to another; think of it as a swiss-army-knife application.

The biggest hurdle is that the RaspberryPI runs an ARM chip, whereas the official TDI distribution is bundled with an Intel x86 compiled IBM JVM only. Unfortunately, IBM has not yet released an ARM compatible JVM, so I’d need to see if I could get the application running with an ARM compatible JVM. In this case, I selected OpenJDK, based on information in this post. Unfortunately, it doesn’t yet include JIT, so the performance will be less than ideal. The JVM can be installed using the standard debian package manager, using the command:

sudo apt-get install openjdk-6-jre libjna-java

So after installing Java, and checking that I could run it, I then attempted to install TDI, using the command line installation options:

sudo ./install_tdiv711_linux_x86.bin LAX_VM "/user/lib/jbm/java-1.6.0-openjdk-armhf/jre/bin/java"

I was hopeful that because they’d included an option to use a system JVM instead of the bundled JVM, that it might just work. One the installer roared to life, I selected only the TDI server component, and after waiting over an hour, the installation eventually completed.

So, would the server start? After fiddling with the JVM settings in the script file (tdiSetJavaHome.sh), I attempted to start the App Server using the following command:

./ibmdisrv -s ~/solutionDir -c ~/HelloWorld.xml -r Hello

After pondering the meaning of life, the application failed with a standard “Class Not Found” exception around the SSL handling, suggesting that the application was dependent on some JARs within the IBM JVM implementation. I fished the required JAR files out of a standard RedHat install of TDI (note: this is never recommended), and then cheekily copied them into the <INSERT_HERE_DIRECTORY>. I also went into the solution.properties file and disabled the SSL, system queue and system store settings to free up RAM. After starting it up again, and crossing all my fingers and toes, the server started.

My test application contained a basic TDI Assembly Line which consisted of HTTP Server component, and a small JavaScript component which calculates PI by iterating over a loop (based on this post). The script in my test example looped over 1 million times. I know its comparing apples and raspberry’s, but I wanted to see how the Raspberry PI compared to my standard work laptop (a Lenovo T410 with a i5 2.53GH CPU). My laptop could perform the loop in 242 milliseconds, whilst the Raspberry PI pumped out the same result in 51132 milliseconds. It doesn’t really prove a lot, and I’m assuming that the 512mb version would perform a little better. Once OpenJDK is optimised for the Raspberry PI, I’m sure the performance will improve.

Laptop Result

Raspberry PI Result

So, it’s not breaking any speed records, but it does prove the old Java adage: write once, run slowly everywhere.