30 January 2008

Cisco's Newest Switch is 20 Times Faster!!!

How would you like to download every movie Netflix has in 40 seconds?! Well Cisco's Nexus 7000 switch claims to be able to support routing 15 terabits of data per second if you can believe that. Crikey! Cisco is claiming that this new swtich is 20 times faster than anything on the market today. There's a very cool interative 3D model of it here.

Evidently this jump in speed is at least partially due to the consolidation of fibre channel, Infiniband and ethernet into a new, smarter type of ethernet cable. The whole idea is to take the virtualization wave that is sweeping the IT industry to the next level to allow for greater sharing of resources across cities and even timezones - whoa! A bit more information is available in this Forbes article if you're interested.

29 January 2008

Using Apple's J2SE Source in Eclipse - Again

This past weekend I had a much larger hard drive installed in my MacBook Pro which required a fresh install of MacOS X on the new drive. This meant I had to manually reinstall the Apple Developer Tools and some other stuff. So today I needed to open some source code from the JDK in Eclipse and it wouldn't resolve. I remembered going through this before and that I had blogged about it so referred back to the old blog entry about using Using Apple's J2SE Source in Eclipse. After a quick check for the src.jar file, I knew what the problem was immediately. However, the installation of Apple's J2SE 5.0 Release 4 Developer Documentation package failed because I now have a newer version of the J2SE installed. Shit.

Pacifist to the Rescue
So I immediately launched Pacifist so that I could pluck the JARs from the package to manually put them in place on disk. Pacifist allowed me to do this in less than a minute and all I had to do was cycle Eclipse. Problem solved ;-).

If you're a MacOS X user and ever need to pluck items from inside of a package, then you need the Pacifist. This is not the first time it has saved me and I hazard a guess it won't be the last.

23 January 2008

Understanding the Threads Allocated in Apache ActiveMQ

If you're using Apache ActiveMQ you should really check out this article. Hiram posted this article on entitled Understanding the Threads Allocated in ActiveMQ (updated link on 13 May 2017).

Hiram wastes no time and dives right down into the heart of the matter to look at how threading works in ActiveMQ from the producer VM to broker VM to the consumer VM. As I read the article I realized that it began with the most amount of threads for asynchronous messaging and was slowly working backwards to less and less threading. At that point I wondered if it was going to completely flatten the threading and remove all buffering from the equation. And that's just where the article went :-).

This is a quick read but is very valuable if you're interested in architecture of ActiveMQ.

22 January 2008

Firefox EC2 UI for Managing Amazon EC2 Images

The instructions for creating an Amazon EC2 image walk through the use of command line tools which is really great. Learning how to do it this way is important because it helps you understand more about what you're actually doing. But once you understand it all, it can be a headache to have to remember all the commands and options because they're all rather similar. So quickly after learning all about Amazon EC2, my buddy Hiram told me about the Firefox Extension for Amazon EC2.

This Firefox extension is such an incredible time saver for most of the tasks of managing images. Starting and stopping images, grabbing the public DNS name of an image, etc. are as easy as clicking a button. After you've taken the time to understand how to create and work with images from the command line, it is definitely worth using this extension.

Amazon EC2 as a Build and Development Environment

How many people are faced with using machines where they're not given root access, it's a headache to get additional software installed and you're required to access those systems using a slow VPN? Although that list is short, there are a number of impedances to making any real progress in there. So to short-circuit the political morass, I took a look at Amazon EC2 and so far I am quite pleased.

Just before the holidays, I took a day to dig in to Amazon EC2 and I must say that having the ability to quickly (less than 30 mins) spin up a machine image, sized to my liking where I have total control of the operating system and the software installed on it is exactly what I needed as a developer.

It took me a couple hours to walk through and understand all the steps to create an image, but it was more than worth it. I did quickly discover that the docs don't tell you that you must size the image to your liking when it's created (see the ec2-bundle-vol utility's --size option). The default image size is 1GB (which is pretty small) and the maximum size is 10GB - I now use 10GB :-). The other thing I discovered was that shutting down an image will clobber *everything* you've installed on that image. This caused me to have to recreate my image a couple times after installing a bunch of software and configuring the image to my liking.

There are certain limitations like I've mentioned above with the storage, no static IPs assigned to images, inability to hack the kernel, and other things. The storage shortcoming I'm already working around by looking into using an Amazon S3 bucket as a filesystem to easily store stuff. The other stuff is really not critical for me so far because I'm just using it as a build and development environment. Maybe if I decide to host real apps on an image someday I'll worry more about them. But for the time being, providing me an environment over which I have total control and only need SSH to access is a major leg up.

There is a cost involved but it's minimal when compared to hosting a machine in a facility. If you need a machine where you have total control and a low cost, I encourage you to take a look at Amazon EC2.

18 January 2008

Associating PIDs with Open Sockets on MacOS X

For years I've used netstat to determine which process is holding onto an open socket. That is, until MacOS X came along. I really like MacOS X but it drives me nuts at times when I find little differences like this that I've relied upon for so long. I know that this due to my lack of familiarity to the differences between Linux and BSD. Anyway, I recently stumbled upon an option while reading the man page for lsof that made me think it might substitute for this missing functionality:

-P This option inhibits the conversion of port numbers
to port names for network files. Inhibiting the
conversion may make lsof run a little faster. It is
also useful when host name lookup is not working

So I gave it a shot (wrapped for display):

$ lsof -P | grep 61616
java 7457 bsnyder 33u IPv6 0x39237f8 0t0
TCP *:61616 (LISTEN)
java 7457 bsnyder 43u IPv6 0x6278a24 0t0
TCP [::]:55496->[::]:61616 (ESTABLISHED)
java 7457 bsnyder 44u IPv6 0x642c8c4 0t0
TCP [::]:61616->[::]:55496 (ESTABLISHED)

Notice the PID in column two of the output above. This is can be incredibly useful especially when piped to other utilities (wrapped for display):

$ ps ax | grep `lsof -P | grep 61616 | awk {'print $2'} \
| uniq`
7457 p6 S+ 0:09.10
/System/Library/Frameworks/JavaVM.framework/Home/bin/java -Xmx512M

Voila! Now I can see what process is holding open port number 61616 (but I already knew that ;-) ).

Now, if I can just find a way to use the --forest option on the ps utility on MacOS X. Using ps -ef --forest on Linux is incredibly helpful yet unavailable on MacOS X. Anybody have any suggestions?