Thursday, November 19, 2009

Fedora 12 Rocks!

I just upgraded to Fedora 12, and I have found the release to be very exciting, at least for me.  You see, I have an HP laptop, and it was a great deal at Best Buy, but it had some hardware that I knew would probably have problems.

It has two pieces of hardware that have had interesting results under Linux.  The first is an ATI (now AMD) HD 3200 graphics card.  While the stock ati open source driver worked with it when I first bought it (right around the release of Fedora 10), it had no hardware acceleration of any kind, not even 2D.  So it worked and was functional, but I really couldn't do much with it.  On the laptop that I replaced, I had an Nvidia card, and really was used to Compiz Fusion, and the way that it enabled me to work.  So, I had to settle for what worked.  Over time I tried to use the proprietary driver, but it never worked reliably, and soon it stopped working on Fedora at all.

With that, I had to wait and see what would happen in the open source drivers for this card.  Well, with Fedora 12, if you install the MESA DRI experimental drivers package, you can now get accelerated 3D, and so far it has worked flawlessly.  It's not giving the frame rates I would expect, but its light years ahead of where it was with software rendering.  I now have Compiz Fusion installed and configured the way I like it, and even though this package is experimental, so far I have had no reliability problems at all!

Kudo's to AMD for releasing the specifications, and Kudo's to the team of developers working on the ati driver and adding this support.  It's simply awesome!

The second piece of hardware that I have had trouble with is the Intel HDA sound card.  While playback always worked, the microphone that is built in to the laptop worked sporadically.  I would get a kernel or driver update and it would start working.  I would get another kernel or driver update and it would be broken again.  Weird things like the volume getting adjusted over 100% on Flash video playback would happen, which was very annoying.  Well, with Fedora 12, I can successfully use Skype to make audio/video calls, and the built-in microphone actually works.  I can also record video with audio in Cheese and that works too!  This has been a real pain, because there are times that I really need to do video conference calls and I just couldn't do it.  Also, the weird adjustment of the volume level in Flash is gone too, which removes a real annoyance from the equation.

This release finally lets me use all my hardware in this laptop, and so far has been completely stable.  I couldn't be more happy.  There are lots of other new features that I would like to explore as well, but I haven't had the time as of yet.

If you haven't checked out Fedora 12, do it, its been great for me, and the much improved hardware support is pretty awesome!

Thursday, January 08, 2009

Time for an Open Source Strategy

In looking at the state of things right now, economically speaking, has there ever been a time better suited for adoption of open source?

I don't think so. Given today's economic situation, closed source license and maintenance fees can choke off the air supply of any business. I know from personal experience, having to cut budgets many times over the years when I was in IT, maintenance fees on closed source software always adds up to a significant amount of money in the enterprise. If you find yourself in that situation, and you have been on the sidelines where open source adoption is concerned, its time to get off the sidelines and into the game!

If you want specific advice in adoption of open source technologies, please don't hesitate to post here.

Good luck to everyone in these very tough economic times.

Wednesday, October 01, 2008

Are you Stupid if you use "Cloud" based Applications or Services?

There has been a lot of recent commentary around Richard Stallman's recent comments about cloud computing, as well as Larry Ellison's comments at Oracle OpenWorld, also ridiculing "cloud computing". With those comments, I started to think about it at a little deeper level then before, and figured it was a good topic to cover for enterprise architecture.

As the buzz around software-as-as-service (SaaS), cloud computing, hosted applications, platform-as-a-service (PaaS), call it what you want, has grown, its become clear that enterprises need to understand these offerings, and determine whether it is right for them. With that, and the fact that some contend this is stupid, let's examine whether it really is or not. Regardless of how you might personally feel about Richard Stallman or Larry Ellison, there is some truth in what they both say.

As anyone who has ever read my blog, or known me personally, should know, I am a big proponent of openness. Openness in the case of open standards and open source. If we look at cloud computing through the lens of openness I can see cases where it can be stupid to depend on it, and cases where it can be very smart indeed. Let's start by looking at the so-called "stupid" cases.

In general, Richard Stallman talked about cloud computing being a trap. In a sense, he is correct. In the case where you are using a hosted application in the "cloud", and your data may be held in a proprietary format, with very high barriers for getting your data out. This is just like buying into the proprietary ERP vendor solutions that have proliferated in IT shops around the globe. Even when you have those in-house, they have your data in a proprietary format, and they make it as difficult as possible to get it out. This makes the barrier to exit very high, which leads to the trap that you can't switch to another vendors solution without unbearable conversion costs! So, the trap isn't really the fact that its a cloud based solution, but that they have your data in a proprietary format, and the switching costs, once they have your data, is too high for most companies to absorb. By definition, this flies in the face of openness and not being locked into any one vendor. Something a lot of IT shops work hard to avoid, but fall right into with both in-house and cloud based software. So, what about cloud based platforms?

In the case of cloud based platforms there is a trap also. The trap is that you use a proprietary platform, with API's and features only available from the cloud provider. This is another area that enterprises should avoid. Instead of trapping you with proprietary data formats, they trap you with proprietary application programming interfaces and techniques, rendering your application non-portable in every sense. You can't lift your application up, and drop it into another cloud from another vendor, and you can't bring it in-house, without re-writing it! Ouch!!! For many years, I battled against using proprietary API's in in-house developed applications, only to be told that we would never switch from x to y! Of course, in all those cases, just the opposite ended up happening. In many cases, changing platforms saved the company millions upon millions of dollars. In fact, this strategy saved my last employer over 26 million dollars in the nine years I was employed there (and this figure has continued to grow over time). Don't fall into the trap with proprietary development API's and features. You will regret it in the long-term. So, that covers cloud based applications, and cloud based application development platforms, what else is there?

Well, there is one more category of cloud based computing. Cloud based infrastructure, where you are provided with a virtualized hardware environment (servers, network and storage), and you can choose to put your choice of operating system, middle-ware and databases in place. This infrastructure can be used for both primary hosting of whatever you want to put on it (whether in-house developed or not), and can be used for dynamic expansion of infrastructure to handle peak loads, now being called "cloud bursting". So, what is this category of cloud computing - smart or stupid?

If the infrastructure allows you to choose the operating system, middle-ware and databases, and you can successfully run you application outside of the cloud, then I would say that this is smart indeed. You have all the control you need to keep your application portable, without the infrastructure investment and on-going management costs. Not to mention the ability to dynamically grow the environment.

In summary, look for cloud based software solutions that are based on open standards (open source as well), with open formats for storing your data, and the ability to easily extract your data through an open interface (perferrably with the ability to do high-volume bulk transfer). If you are looking at platforms for development, only accept those platforms that don't depend on proprietary API's, and keep a running copy on an internal environment somewhere (doesn't have to be large and expensive), to verify that you can run the same application deployed outside of the vendors cloud. If you are just looking for infrastructure, stay with vendors that allow you to choose the operating system, middle-ware and databases. That will keep what you do there portable, whether that's a primary environment or you are using it to do "cloud bursting".

Like most things in life, you can do stupid things and smart things with technology, just try to understand any hidden traps there might be, and keep your solutions open!

Thursday, September 11, 2008

Sprint EVDO Card and Linux

Recently I upgraded to a new phone, and while I was at it I bought one of those mobile broadband cards for my laptop. I had seen enough blogs and e-mail posts on various mailing lists to know that it would probably work. My carrier is Sprint, so I naturally received an EVDO card from them.

Upon my purchase, I noticed from Sprint's own instructions for Linux that you couldn't activate the card on Linux. That could only be done from a Mac or Windows based PC. Well, I happen to have Macs in my house along with my Linux systems, so I went to a Mac, and activated the card. It was very simple, as it automatically ran a Mac version of some software built into the card, and it activated, and connected without issue. So, then I wanted to get it configured to work on my Linux laptop. That's where the fun began.

I'm running Fedora 9, but its also a 64-bit AMD system, and I am running the x86_64 version of Fedora on it. When I plugged in the card, I could see that it was recognized by the OS, and the USB product id and vendor id would display. So, that was promising. I wanted to do this the easiest way possible, so I thought I would just go into the Edit Connections... menu item in the Network Manager applet, and configure from there. So, I did that, and I selected the broadband tab, and clicked on Add. Well, nothing happened. Nothing at all. After a while of digging around, I decided to run the same connection application from the command-line. Sometimes applications will spew out errors to standard error that never are displayed in the GUI, so I thought that I might learn something.

So, I ran nm-connection-editor from the command-line, instead of from the Network Manager applet, and what do you know, an error message spews out when I try to add a broadband connection. Here it is:

** (nm-connection-editor:4208): WARNING **: create_new_connection_for_type:
unhandled connection type 'NMSettingCdma'

** (nm-connection-editor:4208): WARNING **: Can't add new connection of type
'cdma'
After some searching, I found out that the x86_64 version of Network Manager actually didn't have the broadband code implemented in the version that was in Fedora 9. So, I opened a bugzilla on it, and I ended up getting a response saying it was fixed in a version that was in Fedora 9 updates testing.

So, after getting the appropriate link to where these packages where, I decided to install them and try it out. Well, I must say I couldn't be happier. It worked flawlessly, and it detected the correct type of card, and filled in all the information for it, and I didn't change anything other than the default connection name that the wizard had filled in. At first, I thought no one has ever documented adding a mobile broadband card through the Network Manager interface, so I would do that. After thinking about it though, it was so easy, that there really isn't any value in documenting it.

This is truly the way things should be. Plug in your device, right-click and select Edit Connections..., then select the Mobile Broadband tab, click Add, and click OK! It couldn't get much easier than that! Whoops, I guess I just documented it!

So, if you haven't used the Network Manager for doing this, its certainly a lot easier than setting up PPP scripts that I have seen documented by many people. Give it a try, you'll like it.

Friday, August 29, 2008

Can Software Patents Get Any Worse?

Today, I read an article that states Microsoft has been granted a patent for "Page Up" and "Page Down"! I laughed when I saw the title, and I couldn't believe it. Here is a link to the article:

Microsoft patents 'Page Up' and 'Page Down'

It has become amazing what you can get a software patent for. I really don't even know what to say, its so shocking!

Simply amazing!

Tuesday, February 19, 2008

JVM Performance Tuning

Last week was JBoss World, and it was exciting to be a part of it. I gave a presentation on performance tuning our Enterprise Application Platform or EAP, and it was packed. In fact, people were sitting on the floor in pretty much all available space. What struck me about the presentation, and much of the discussion I had with individuals afterwards, is that JVM tuning is a big topic. So, I thought I would share some of what I learned over the past couple of months as I was preparing for my presentation.

In preparing for my presentation, I wrote an EJB 3 application, wrote a load test for it, and applied optimizations to various configuration parameters within the EAP, the JVM and the operating system. In particular, one JVM and OS setting really made a huge difference in throughput, and its something that I wanted to share here.

When using a 64-bit OS, in my case Fedora 8 and RHEL 5.1, I wanted to investigate the usage of large page memory support, or HugeTLB as its referred to within the Linux kernel. What I found was very scarce documentation around using this, and that that documentation was incomplete to actually make it work. What I also found, is it makes a huge difference in overall throughput and response times of an application, when using heap sizes above 2GB.

So, without further ado, let's dive into how to set this up. These instructions are for Linux, specifically for Fedora 8 and RHEL 5.1, but the results should be generally applicable to any 64-bit OS and 64-bit JVM that supports large page memory (which all the proprietary UNIX's do, and I found an MSDN article describing how to use this on 64-bit Windows).

You must have root access for these settings. First, you need to set the kernel parameter for shared memory to be at least as big as you need for the amount of memory you want to set aside for the JVM to use as large page memory. Personally, I like to just set it to the maximum amount of memory in the server, so I can play with different heap sizes without having to adjust this every time. You set this by putting the following entry into /etc/sysctl.conf:

kernel.shmmax = n

where n is the number of bytes. So, if you have a server with 8GB of RAM, then you would set it to 8589934592, or 1024*1024*1024*8, which is 8GB.

Second, you need to set a virtual memory kernel parameter to tell the OS how many large memory pages you want to set aside. You set this by putting the following entry into /etc/sysctl.conf:

vm.nr_hugepages = n

where n is the number of pages, based on the page size listed in /proc/meminfo. If you cat /proc/meminfo you will see the large page size of your particular system. This varies depending on the architecture of the system. Mine, is an old Opteron system, and it has a page size of 2048 KB, as shown by the following line in /proc/meminfo:

Hugepagesize: 2048 kB

So, I wanted to set this to 6GB. I set the parameter to 3072, which is (1024*1024*1024*6)/(1024*1024*2). Which is 6GB divided by 2MB, since 2048 KB is 2MB.

After this, you need to set another virtual memory parameter, to give permission for your process to access the shared memory segment. In /etc/group, I created a new group, called hugetlb, you can call it whatever you like, as long as it doesn't collide with any other group name, and it had a value of 501 on my system (it will vary, depending on whether you use the GUI tool, like I did, or whether you do it at the command line, and vary depending on what groups you already have defined). You put that group id in /etc/sysctl.conf as follows:

vm.hugetlb_shm_group = gid

where gid, in my case was 501. You also add that group to whatever your user id is that the JVM will be running as. In my case this was a user called jboss.

Now, that concludes the kernel parameter setup, but there is still one more OS setting, which changes the users security permissions to allow the user to use the memlock system call, to access the shared memory. Large page shared memory is locked into memory, and cannot be swapped to disk. Another major advantage to using large page memory. Having your heap space swapped to disk can be catastrophic for an application. So, you set this parameter in /etc/security/limits.conf as follows:

jboss soft memlock n
jboss hard memlock n

where n is equal to the number of huge pages, set in vm.nr_hugepages, times the page size from /proc/meminfo, which in my example would be, 3072*2048 = 629146. This concludes the OS setup, and now we can actually configure the JVM.

The JVM parameter for the Sun JVM is -XX:+UseLargePages (for BEA JRocket its -XXlargePages, and for IBM's JVM its -lp). If you have everything setup correctly, then you should be able to look at /proc/meminfo and see that the large pages are being used after starting up the JVM.

A couple of additional caveats and warnings. First, you can dynamically have the kernel settings take affect by using sysctl -p. In most cases, if the server has been running for almost any length of time, you may not get all the pages you requested, because large pages requires contiguous memory. You may have to reboot to have the settings take affect. Second, when you allocate this memory, it is removed from the general memory pool and is not accessible to applications that don't have explicit support for large page memory, and are configured to access it. So, what kind of results can you expect?

Well, in my case, I was able to achieve an over 3x improvement in my EJB 3 application, of which fully 60 to 70% of that was due to using large page memory with a 3.5GB heap. Now, a 3.5GB heap without the large memory pages didn't provide any benefit over smaller heaps without large pages. Besides the throughput improvements, I also noticed that GC frequency was cut down by two-thirds, and GC time was also cut down by a similar percentage (each individual GC event was much shorter in duration). Of course, your mileage will vary, but this one optimization is worth looking at for any high throughput application.

Good luck!

Monday, February 04, 2008

Yahoo and Microsoft; Mixing Oil and Water

Every since Microsoft announced its $44.6 billion dollar offer for Yahoo, there have been many articles flying around about the potential merger. What I find most interesting, is the lack of coverage of the technology issues around such an integration.

I have seen only two articles that have mentioned technology differences between the two companies as an integration challenge. I think this is a huge oversight in the coverage of the acquisition.

From what I know of Microsoft, and what I have heard of Yahoo's technology, you simply cannot downplay the challenge of putting these two companies together. They are polar opposites where engineering is concerned, and Microsoft is living in a dream world if they think they are going to get any synergy from combining the two engineering teams.

Good software developers tend to be pretty picky about the technologies they work with, and are probably with the company they are with, in large part, because of the technologies employed.

In the case of Microsoft, there is no speculation about what technologies will be employed. They will be Microsoft technologies, period. This is illustrated by Microsoft's acquisition of HotMail. HotMail was deployed on an open source infrastructure, and I believe they were using BSD as the operating system. When Microsoft acquired them, the first thing Microsoft wanted to do was move HotMail to a Microsoft platform. Of course, this failed at first, but I believe they eventually did succeed in getting HotMail moved to a Windows platform. With the difficulties of just moving this one application, you have to consider moving the entire Yahoo portfolio over to a new platform to be an insurmountable task.

From everything I've heard about Yahoo's technology platform, it is largely based on open source. Just like HotMail was. If I were a Yahoo software developer, and I was asked to move my work to a Microsoft platform, I would simply quit. Now, they will have a Microsoft retention package that will attempt to keep them at the company, but I really don't see this as something that will keep the most talented folks around. Now, Microsoft could decide to allow the Yahoo platform to be the platform that stays, but this is so totally against the Microsoft culture, that I don't see this happening. This also poses a lot of problems for all their existing technology and their other acquisitions. Would they truly be willing to throw all the other technology away, or have those engineers move their technology to open source, and into the Yahoo infrastructure? Again, I don't see that happening, and they would also risk losing those existing engineers for the same reason that Yahoo engineers would leave.

If this merger isn't akin to mixing oil and water, I don't know what is!