Stumbled across a great resource for the different options for JVM tuning the other day…A Collection of JVM Options. Definitely worth bookmarking if you ever need to do some Java tuning!
Archive for August 2007
Stumbled across LibraryFind the other day and have been playing around trying to get it installed. I’ve not had many good experiences with Ruby based apps, but this looked really promising so I took the plunge. Unfortunately the searching doesn’t work because and just states that there was an error. Looking in the log files, it states that its “missing default helper dispatch_helper” and the record_set_helper. I also ran into a problem in the admin module when I attempted to add a target…just got a recordschema error. I ended up just writing a script to install a couple of EBSCO targets we had, but hopefully once I figure out what’s going on with the helpers, that problem will be resolved too.
Google has made it very easy to embed a functional Google map into any web page or blog. “Users can drag and click or zoom in on a location, and view it in map, satellite, and hybrid modes.”
Read the press release here: Google announces a simple new way to embed Google Maps.
There was some discussion on the Vufind about moving from Tomcat to Jetty. I first wanted to see if it was possible to run this so I got the latest nightly build from Solr to see which packages were needed to run the server. I then grabbed the latest Jetty (6.1.5) since the version in Solr’s build was 6.1.3. I packaged the same files that were in Solr’s distribution and dropped Vufind’s schema and config file into Jetty and fired it up. Voila…it worked like a champ.
The thing I really wanted to know is if this Jetty version would perform in a similar fashion to Tomcat. What I did to test was set up two visualized servers on the same box. Each were set up with the exact same hardware (2GB RAM, 1 processor, bridged 1GB network, running Ubuntu 7.04 server). I also used the same Java tuning on both machines (“
-server -Xmx1024m -Xms1024 -XX:+UseParallelGC -XX:+AggressiveOpts“). The only difference between the two was that one ran Tomcat and the other Jetty.
For the test, I indexed our library’s 1.8+ million catalog records on both machines which both chewed through the records in about 9 hours. To do the actual testing, I used JMeter to query both systems at the same time using a few scenarios that I thought might possibly be “real.”
In the first test, I sent 10 users with 100 queries for the book title “Flashman” to see what happened. I was pretty impressed with the results:
You know, we might get a few more users than just 10 at a time, so I ramped it up to 100 users doing 10 queries. Again, there wasn’t much of a difference.
Now to really ramp things up with 100 users doing 100 queries
And, just for kicks, 1000 users with 10 queries
With median results within a millisecond of each other, Andrew went ahead and swapped out Tomcat in favor for Jetty for its smaller footprint. I have to say that any time I’ve needed to do anything with JSP, I’ve opted to go with Tomcat. More because I know the name, but I think I’m going to keep Jetty on my list from now on! I want to take a closer look at their ANT and Eclipse Plugins!
Wayne and Phil finally convinced me to switch operating systems on my office laptop. Wednesday they gathered around me as I took a deep breath and pressed enter to launch the installation of the Ubuntu version of Linux. Afterwards they led me, rapidly, through the installation of various applications and repositories using the command line interface and using the Synaptic Package Manager. I installed VMserver to run the few Windows applications I need, like the Unicorn client, Workflows. Next I need a book to achieve some independence. Right now it is still “Hey Wayne, how do I …” and “Wayne, why is it doing …”
I copied all my documents to another server prior to installing Ubuntu. From there I burned everything to CD. I find it liberating to be free of all the junk I had installed on my laptop and all the documents I had accumulated but not looked at for years. I still have the documents if I need them but I am greeted by a very clean desktop.
I think I am going to start using Google documents more. I like the ability to quickly share. Ubuntu automatically installs OpenOffice so I can easily create local documents.
Day-by-day use of Ubuntu is nothing I have to think about. I only have seven application icons on my toolbar: Synaptic Package Manager, Firefox, Help, VMserver console, Pidgin, Thunderbird, and a terminal window.
My desktop only has folders with the Unicorn API documentation, and two links to our shared library network drive. One is an ssh link and the other is a Windows share. I only mounted the Windows share because there were some permissions issues when I was transferring files around. These links give me very quick access my folders and documents stored on the library’s shared network drive.
Before Ubuntu, I was not able to get a connection to my home wireless network. No matter what steps I took, which wizards I used, I couldn’t get a connection. When I brought home my laptop with Ubuntu I was connected in about a minute because that is how long it took to key in my pass code. Amazing.
We will see what unfolds over the next weeks but I’d say that I’m a Linux convert.
Had a few more notes on running VuFind.
Something that is generally looked over when setting up a Java application is tuning Java. This can be a very daunting endeavor as you generally see tutorials that reference things like interpreting p-values and power analysis. However, if you’re just wanting to set an application up, this is a much larger investment of time and effort that is really needed. So, here are some things you probably want to do.
To set the Java ergonomics for server applications, you simple set a new environmental variable. For Tomcat, this is the
CATALINA_OPTS. For development boxes, I tend to make these global variables, but as long as the user account that’s running VuFind’s Tomcat instance has
CATALINA_OPTS defined, you’ll see the performance boost.
For those who can’t wait, this is what I set for my instance in a visualized instance of Ubuntu server (Feisty) that runs with 2 GB RAM and a dedicated dual-core x86_64 processor.
CATALINA_OPTS="-server -Xmx1024 -Xms1024 -XX:+UseParallelGC -XX:+AggressiveOpts"
I don’t have any heuristics on the improvement, but it is a noticeable difference in both speed and processor utilization.
Without attempting to rehash the nitty-gritty of the ergonomics of the JVM, you’re bascially telling Java to act as a server, use a statically sized heap (the memory allocated for object storage), uses young-generation garbage collection (it divides garbage collection across processors), and turning on point release performance optimizations.
For more info on setting up the JVM to be “server-class”, check out the Java Tuning White Paper. While this paper specifically refers to the Java 5 platform, these same options will work if you’ve deployed under Java 6.