HOW TO : Improve Jboss startup times

December 31st, 2009

We run multiple applications in Jboss at my work and one of the applications used to take an inordinate time to come up. A typical application would take < 1 minute to get deployed and this particular application for some reason was taking ~7-8 minutes. We initially thought it was a bug in the code and gave hell to our development team :) .. But on closer investigation, we found out that a feature we enabled in the Jboss server settings which allows content to be hosted on network storage was causing the issue.

I blogged the feature in Jboss to follow sym links here (http://kudithipudi.org/2008/07/25/howto-configure-jboss-to-follow-symbolic-links/). So essentially when Jboss was started, it was checking all the content in these network path to check for applications to deploy. And traversing a network share with 1000s of directories isn’t fun :) ..

We fixed it by making a simple edit to the start up script. Here’s the psuedo code for the script

  1. Remove soft links to network share
  2. Start Jboss
  3. Put soft links to network share

And now the application starts in less than a minute :) .

I guess there might be other elegant ways to do this. i.e. Configure Jboss to only deploy certain applications, but this did the trick for us :) .

HOW TO : Advanced search and replace in Notepad++

December 13th, 2009

Jhanvi asked me to help with editing a text file recently. She had a file in the format

'512'
'345'
'876'

and needed to convert it into the format below

INSERT INTO BLAH VALUE ('512');
INSERT INTO BLAH VALUE ('345');
INSERT INTO BLAH VALUE ('876');

There are multiple ways, one can do this. Here is how I did this using Notepad++, an open source text editor. I used the regular expression capability of Notepad++ it’s search and replace function.

  • Press “Ctrl + h” to bring up the search and replace window.
  • Replace the single quote at the beginning of the line by using ” ^’ “
  • Replace the single quote at the end of the line by using ” ‘$ “

Screenshots from the operation

The data in it’s original format

Replacing the first quote mark

Data after the first search and replace operation

Replacing the second quote mark

Data in the final format

HOW TO : Load/Stress test a Linux based server

December 9th, 2009

We ran into an issue at work recently, which prompted us to do some performance testing on some of our Linux servers. The requirement was to stress test the key components of the server (CPU, RAM, HDD, Network) and prove that different servers with the same configuration were capable of performing identically. Pretty simple right :) .. The challenge was to find tools that could be run to stress test each of the components. There were a lot of tools for CPU and memory (RAM) testing, but not a lot for network and hard drive (HDD) testing. After searching high and low, we found a couple of tools, that I wanted to document here for future reference.

HDD Testing :

I found a pretty interesting tool called Iozone written by William Norcott (Oracle) and Don Capps. You can get the source code and builds for major OSs at http://iozone.org . Despite installing the program using RPM, we were not able to  run the program without specifying the complete path.

There are a ton of options for the program, but the easiest method to run it was in automated mode with the output going to an Excel spreadsheet (more like a glorified CSV file :) ). Here is the command we used

/opt/iozone/bin/iozone -a -Rb output_excel_file.xls

The “-a” is to tell the program in automated mode and the “-Rb” is to tell the program to format the output in Excel format. And you can then go ahead and open the spreadsheet in Excel and create 3D graphs to check and compare the output.

Network Testing :

Most of the information out there in terms of testing the network stack of a machine is either to copy large files over a network share or via FTP. We didn’t find that was enough to really max out a Gigport since there were protocol limitations that didn’t allow us to saturate the network port. After some searching, we stumbled across a tool called “ettcp” on Sourceforge. ettcp itself is an offshoot of ttcp. ttcp (stands for test tcp) was created to test network performance between two nodes. I couldn’t find any place to download ttcp itself, but you can download ettcp at http://ettcp.sourceforge.net/.

We used a server, to act as a common receiver for all the servers we intended to do a performance test on. Here are the commands we used to run the test

RECEIVER (Common Server)
./ettcp -r -s -f M

The options are

  • “-r” for designating the machine as receiver
  • “-f M” for showing the output in Mega Bytes.

TRANSMITTER (Test Servers)
./ettcp -t -s receiver_hostname -n 10000000 -f M

the options are

  • “-t” for designating the machine as transmitter
  • “-s receiver_hostname” to define the receiver
  • “-n” to define the number of packets to send to the receiver

Wikipedia Needs You!!

December 7th, 2009

As you check the list of charities and gifts you need to contribute to for this holiday season, please put Wikipedia on your list :) . I did my part by supporting the annual Wikipedia fund raising effort. It is not easy and cheap to be running one of the most popular (6th most popular as per Alexa’s latest figures) sites on the Internet.

Donate.. Share..Enlighten :)

Here is the link to the donations page http://wikimediafoundation.org/wiki/Support_Wikipedia/en

Gone Fishin..

December 4th, 2009

Click on the image for some great music :)

This picture was taken on my recent trip to Costa Rica.

Costa Rica & Towels..

December 4th, 2009

Jhanvi and I went on a trip to Costa Rica recently and in addition to being amazed by the nature of the country, we were also charmed with the decorating skills of the maids in our hotels :) .  Take a look at the pictures below to understand why..

PS : If you haven’t visited Costa Rica yet, put it on the list of places to visit in your lifetime :)

Never Give Up : Part 2

November 19th, 2009

A follow up on my post, about a South Korean woman’ attempts to get a driving license despite failing it hundreds of times.. She finally passed the exam on the 11/6/2009 in her 950th attempt (http://news.bbc.co.uk/2/hi/8347164.stm) !!!

Congratulations, Mrs Cha Sa-Soon !!

Reminder for the rest of us to never give up :) .

I don’t use Twitter..

November 16th, 2009

More supporting data for my post that Twitter is not going to make it, looks like 47% of Lifehacker users (and they are tech savvy users) don’t use or care about Twitter (http://lifehacker.com/5403214/do-you-use-twitter).

Humanity or Clicks?

November 9th, 2009

Thought provoking article on TechCrunch (http://www.techcrunch.com/2009/11/07/nsfw-after-fort-hood-another-example-of-how-citizen-journalists-cant-handle-the-truth/) about how folks are obsessed with being the “ones” with the first to take a cool picture or tweet about something rather than trying to help the people in need they are taking pictures of..

I ran for Chocolate!!

November 3rd, 2009

Jhanvi and I successfully finished the 2009 Hot Chocolate 15K, held on the lake shore of Chicago last weekend. Not a surprise that Jhanvi beat me by 1 second :) . Her finish time was 1:46:27 and mine was 1:46:28. It was a chilly day, but after a couple of miles we fell into the rhythm and enjoyed the race. The only disappointing portion of the race was the watery hot chocolate that was provided at the end of the race. I am not sure if it was a case of the organizers underestimating the crowd or if they were being cheap, the hot chocolate (which was supposed to be the attraction of the race) was pretty watery.

Yes.. people do run ~9 miles to get a cup of hot chocolate :) .