|
More and Less
Giving Java Apps Just What They Need Story by Al Riske. Photography by Howard Friedenberg. July 23, 2009 - One of the greatest virtues any computer operating system can have is simple stability. So you really don't want to mess with the thing if you don't have to. "If you mess with the operating system and get it wrong, the whole machine goes down," notes Mick Jordan, a senior staff engineer in Sun Labs. As a result, he says, the pace of innovation at the level is necessarily a bit slower. People are reluctant to experiment, and rightly so. Until now. Jordan is working on a project called Guest VM (based in part on another labs project known as Maxine), which could dramatically reduce the role of traditional server operating systems.
The project was inspired by a simple observation. "Typically what's happening on a production server that's running a large Java application is there's just the operating system and the Java application. There may be a few other processes related to networking but basically it's a one-to-one relationship," Jordan points out. "In fact, because of the size of most Internet-facing applications, one machine isn't big enough." So a single application is often spread logically over multiple machines. That is, horizontally scaled. "In that context the operating system is not being used in its normal mode of being a time-sharing system," Jordan says. "It's just doing one thing which is supporting the Java application." Which means that an awful lot of what goes into a modern operating system is just taking up space -- space that could be put to better use.
Add to that the growing popularity of virtualization and a whole new world begins to open up. Jordan believes that hypervisors -- software that allows multiple operating systems (“guests”) to run concurrently on any host computer -- will soon be everywhere. "Hypervisors open up innovation in this area, because it's safe to mess with things in these guest operating systems. They're not as critical," Jordan says. "The hypervisor has to be very stable, but the other operating systems that are running in this virtualized world don't have to be. They can be unstable. They can have bugs. We can do experiments without bringing down the whole system."
The experiment that Jordan is doing is this: He wants to see if he can create a complete software stack, implemented entirely in Java and hosted on Xen, the popular open-source hypervisor, with just the thinnest layer of old-style C code in between. Make no mistake, though. He is not interested in created a Java operating system, just a better implementation of the Java platform. "I'm not interested in trying to replicate all of Solaris or all of Linux. That would be like trying to boil the ocean. Why would anyone want to do that?" Jordan says. "We want to minimize the use of server resources and get the most out of the machine that we can. We don't need all the extraneous stuff that's in the operating system to support all kinds of other activities. Java's needs are very specific whereas the operating system is very general, so there's tons of code in there we don't need. We can just replace it with the pieces we need and optimize them for Java."
The potential advantages of the Guest VM are fourfold: improved performance, better thread management, simplified administration, and increased developer productivity. All because the entire stack is written in Java. That means there are few cumbersome transitions between layers that are often written in different programming languages. It also means that the Java runtime compiler can optimize all of the code, not just some of it, on the fly. The thread scheduler can work more intelligently, too, since it can see and understand the purpose of the threads that support the Java virtual machine -- for example, those supporting the garbage collector. Administration is easier because you can do it all at the Java level. And, finally, developer productivity can be enhanced because Java is a high-level language with advanced programming tools. (Jordan for one has a strong dislike of C, and says that "C++ is the ultimate evil as far as I'm concerned -- the most appalling language ever invented.")
All of this is about to be tested, Jordan says. The Guest VM is capable of running a variety of micro-benchmarks and test programs, and it can run the SPECjbb benchmark, which simulates a server-side application. And it's almost ready to run large real-world applications such as Glassfish or Hadoop, which will provide the ultimate test.
"Is there a significant advantage in this or not? We don't really know. We know those transitions between layers are relatively expensive, but when you sum it all up, maybe it's a wash. Until we get big enough systems running that we can actually do the measurements -- we don't really know the answer to that. That's one of the big research questions -- whether there's a performance benefit from having this single-language stack of software all under the control of the Java runtime," he says. "There are a lot of things in computing that stand to reason. Unfortunately computer science's intuition about performance is notoriously poor. The system is complicated enough that you may find you didn't really understand it well enough, and your intuition is just wrong. So I'm not going to stand up and say, 'This will definitely be better.' But it certainly has that potential." |
|
||||||||||||||