Embedding Google Maps

Posted August 23, 2007 by Mack Lundy
Categories: Uncategorized

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.

Advertisements

Benchmarking Solr

Posted August 16, 2007 by Wayne Graham
Categories: java, system_administration, technical, technology, Ubuntu, vufind

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:

Server Samples Average Median Min Max
Jetty 1000 4ms 4ms 1ms 17ms
Tomcat 1000 3ms 4ms 0ms 28ms

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.

Server Samples Average Median Min Max
Jetty 1000 12ms 8ms 1ms 565ms
Tomcat 1000 9ms 7ms 1ms 530ms

Now to really ramp things up with 100 users doing 100 queries

Server Samples Average Median Min Max
Jetty 100000 9ms 6ms 1ms 2349ms
Tomcat 100000 9ms 6ms 1ms 1844ms

And, just for kicks, 1000 users with 10 queries

Server Samples Average Median Min Max
Jetty 10000 32ms 6ms 0ms 5643ms
Tomcat 10000 26ms 5ms 0ms 4295ms

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!

Breaking Windows

Posted August 12, 2007 by Mack Lundy
Categories: linux, Ubuntu

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.

Doomed?

Posted August 2, 2007 by Mack Lundy
Categories: facebook, MySpace, SecondLife, social networking, Twitter

I use this blog to promote technology within MPOW but this article annoyed me: MySpace, SecondLife, and Twitter Are Doomed. When I first read it, I came away with an impression of schadenfreude on the part of the author. I let the article sit for a couple of days and re-read it and am still annoyed by the tone.

Sure there are problems with Myspace, SecondLife, and Twitter. I’ve pretty much abandoned MySpace for Facebook because there is a growing librarian community there and I gain value from using it. Until I learned how to tweak my profile in MySpace, I was bombarded with messages from young women who wanted to be my friend and, by the way, please look at these photos of me. SecondLife is slow and kludgey but it has put me in contact with more people than would otherwise be possible. I’m not sure how I could have participated in a book discussion led by a British physics professor who was in Brazil and attended by people from around the world. Twitter? Well, I don’t get the appeal there either but it doesn’t bother me that it exists.

The author is quite correct in pointing out that there are problems with these social applications and that they may/will eventually disappear. I say, “So what.” All of the social networking applications are evolutionary steps. Some will work, some won’t. I believe that there are people looking at these applications and thinking, “OK, the concept is interesting but I bet I can make it better, faster, stronger and maybe I can combine the best elements of several into a new approach for social networking.” You have to have a foundation to build anything and the current crop of social networking applications are a foundation for future applications.

Sure the press hypes these applications but again, so what. Hype is what lets people know something exists. Hype is what might get a developer interested in looking for ways to improve on a concept or develop a new approach for these social networking applications. Look at what is happening in Facebook. It is becoming a platform where new third party applications are being built daily. You can add your Twitter, Flickr, Google Reader accounts, etc., effectively making Facebook the first application you want to open in the morning.

The author concludes, ironically – Till the next “Big Thing.” I say “Cool, I can’t wait to see what comes along.”

Java Tuning for VuFind

Posted August 1, 2007 by Wayne Graham
Categories: java, Library 2.0, technology, tips, vufind

Had a few more notes on running VuFind.

Java Tuning

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.

VuFind with Ubuntu

Posted July 30, 2007 by Wayne Graham
Categories: Future of OPACs, how-tos, OPAC, vufind

This is an old version. Please view the updated post at https://techview.wordpress.com/2007/10/30/vufind-06-on-ubuntu-710/

A beta release VuFind was recently released as an ILS replacement by Villinova. However, getting it to run properly on my virtualized server was a bit of an adventure. So, in order to spare others, here are some development notes for installing VuFind 0.5 on Ubuntu.

Most of this you can copy and past into a bash script (in fact, that’s where I put most of this stuff). As soon as I get a chance, I’m going to build an installer for this, but in the mean time:

Upgrade your distribution:

sudo apt-get -y dist-upgrade

Install some needed base packages

sudo apt-get -y install subversion ssh build-essential sun-java5-jdk

You can use the sun-java6-jdk, just make sure to update the code further down that sets the JAVA_HOME variable.

Next, install and configure Apache2 to use mod_rewrite

sudo apt-get -y install apache2
sudo ln -s /etc/apache2/mods-available/rewrite.load /etc/apache2/mods-enabled
sudo /etc/init.d/apache2 reload

Currently, the subversion repository doesn’t have all the files to run Tomcat, so you need to grab both


svn co https://vufind.svn.sourceforge.net/svnroot/vufind /usr/local/vufind
wget http://downloads.sourceforge.net/vufind/VUFind-0.5.tgz?use_mirror=osdn
tar -zxvf VUFind-0.5.tgz
cd VUFind-0.5
sudo rm -rf /usr/local/vufind/solr
sudo mv solr /usr/local/vufind

Next, change the permissions on the cache and compile folders

chown www-data:www-data /usr/local/vufind/web/interface/compile
chown www-data:www-data /usr/local/vufind/web/interface/cache

Install and configure MySQL

sudo apt-get -y install mysql-server
mysqladmin -u root create vufind

Install and configure PHP 5 and the required libraries

sudo apt-get -y install php5 php-pear php5-ldap php5-mysql php5-xsl php5-pspell aspell aspell-en

Note, this doesn’t include the PDO_OCI library for dealing with Oracle. You’ll need to grab that one if you need it.

Install YAZ (updated 8/1/07)

sudo apt-get -y install yaz

Build YAZ from the source files

wget http://ftp.indexdata.dk/pub/yaz/yaz-3.0.8.tar.gz
tar -zxvf yaz-3.0.8.tar.gz
cd yaz-3.0.8
./configure
make
sudo make install

There’s an issue with the default version of PEAR installed with PHP on Ubuntu and you’ll need to upgrade this…

sudo pear upgrade PEAR

You may also want to edit the install script that’s included in the package to read

mv Smarty-2.6.18/libs* $PHPDIR/Smarty

You’ll need to set up Apache and MySQL still…

In /etc/apach2/apache2.conf add the following lines:


Alias /vufind /use/local/vufind/web


<Directory /use/local/vufind/web/>
AllowOverride ALL
Order allow,deny
allow from all
</Directory>

and reload

sudo /etc/init.d/apache2 reload

Now set up your JAVA_HOME environmental variable. Since this is a global (at least for me), I put it in /etc/environment

JAVA_HOME="/usr/lib/jvm/java-1.5.0-sun"

Note, if you just the sun-java6-jdk, be sure to change the above line to

JAVA_HOME="/usr/lib/jvm/java-6-sun"

You can run source on this file to pick up the variable, but because you’ll probably sudo in a development environment, it’s probably easier just to reboot the system.

Lastly, set up MySQL data tables


mysql -u root
GRANT ALL ON vufind.* TO vufind@localhost IDENTIFIED BY "secretPassword";
quit

mysql -u vufind -p vufind < mysql.sql

This is a change from the provided documentation as it creates a new user (so you’re not running the database as root). Also, you’ll want to be sure to change the default root password of nothing to something other than that.

Now, if everything has gone nicely, you should be able to run the Solr server now. You do have to be in the /usr/local/vufind directory in order for this to start properly.


cd /usr/local/vufind
./solr/tomcat/bin/startup.sh

Make sure everything is running now. Check out your systems at

http://your.ip.address:8080/solr/admin
http://your.ip.address/vufind

Lastly, a small change in running the yaz-marcdump from the example. The utillity will be happier with

yaz-marcdump -f MARC-8 -t UTF-8 -X marcFile.mrc > catalog.xml

if you’ve installed the debian package. If you’ve installed from the source, use the example code

yaz-marcdump -f MARC-8 -t UTF-8 -o marcxml records.marc > catalog.xml

Hopefully this will save some folks some hunting…

Facebook

Posted July 19, 2007 by Wayne Graham
Categories: facebook, social networking, Social Software, web 2.0

Today’s Third Thursday Tech Talk (t4) showcased facebook.com and our library’s contribution SwemTools. I embedded the Facebook Presentation, but most of the links are below:

Video:

Fred Stutzman’s Our Lives, Our Facebooks – given at one of Google’s TechTalks

Facebook Groups for Librarians

And of course, SwemTools.

If you’ve got comments about SwemTools specifically, please post them on the application page.