¡@

Deploying Enterprise Web Services by Distributed JVM Approach

 

 

Introduction

This project aims to explore the potential of distributed Java Virtual Machine (DJVM) in clustering today¡¦s web application servers. DJVM is a group of connected JVMs for parallel execution of a multithreaded Java program. The JESSICA2 system developed by our research group is a representative example of DJVM. JESSICA2 employs a transparent Java thread migration technique for dynamic load balancing among the cluster nodes. A distributed shared heap called Global Object Space (GOS) and I/O redirection mechanisms are built into the system for location-independent object accesses and socket or file I/O operations. Several optimization techniques, namely object home migration and object pushing, are designed to boast the overall performance. With these useful features, JESSICA2 DJVM has been very successful in parallelizing compute-intensive scientific applications. However, we see the ultimate scope of applications can be much broader and should cover the mainstream web-application workloads. Since nowadays most web applications are running on top of an application server, we target at clustering of Java web application servers such that most web applications can scale out without modification. This can be done transparently by replacing the JVM layer with a DJVM and we call this the distributed JVM approach.

¡@

Compared to traditional server clustering, the advantages of this approach are multifold:

  1. This generic approach simplifies a broad array of traditional clustering technologies using RMI, JNDI, JMS, JavaGroups, etc and a lot of complex setup. All clustering decisions and efforts are shifted from web application programmers and application server developers to the JVM layer. Once this technology is matured, the costly development and maintenance of the clustered version of web applications and the application servers can be saved. 

  2. Nowadays web object caching is vital to performance. Traditional Tomcat clustering via load balancing web connectors like Apache mod_jk, see Figure 1(a), is an uncoordinated approach and no object sharing is supported (unless web applications are intrusively modified to use framework like JavaSpaces). So each server is caching redundant web objects and memory is not in efficient use. With DJVM's object sharing capability (like JESSICA2's GOS), cooperative caching by distributed threads can generate a significantly higher cache hit rate for most cacheable web services.   

  3. Sticky sessions used in traditional clustering solutions may cause server load imbalance. With DJVM, HTTP sessions can be transparently viewed at every node (through remote object fetching, see Figure 1(b)). So every server can take up the service of the requests belonging to any session. Dynamic thread migration can make further load adjustment even after the requests have been dispatched to the servers to even out any load imbalance, which is not possible in traditional mechanisms.

¡@

(a)                                                                                                                (b)

Figure 1. Comparison of traditional and DJVM-based Tomcat clustering

¡@

To testify this approach, we ported the popular web application server Apache Tomcat onto JESSICA2. Apache Tomcat is the official reference implementation of the Java Servlet and JavaServer Page (JSP) specifications. It is also the most widely used open-source web application server. Due to class library limitation, we only ported Tomcat 3.2.4 but it is totally sufficient for demonstrating the soundest features of our approach. 

¡@

¡@

Challenges

In our experience, JESSICA2 favors compute-intensive applications. Workload composed of short-lived requests involving many accesses to hash tables holding information like status codes, MIME types and servlet mappings are difficult to scale because of intensive remote locking of the shared tables. This is the biggest challenge in this project. We decided to upgrade JESSICA2 to support cluster-wide volatile field semantics and thus allow the use of ConcurrentHashMap found in latest JDK class library for fine-grained object locking. Other intensive object locking overheads due to thread pooling and connection pooling are addressed by porting - we disable their use or revamped into connection caching using thread-local storage which is an increasingly popular alternative to object pooling. Our future research will investigate incorporating software transactional memory into DJVM for better scalability for lock-intensive Java applications.

¡@

Another great challenge is to resolve a number of compatibility issues or bugs in order to make Tomcat run stably at high workload. Tomcat is among the top ten large-scale and complex open-source projects in the world, it seems there have been very few attempts in the Distributed Shared Memory (DSM) or DJVM research areas to get such kind of real-world and large-scale application systems to work stably and efficiently on top of their research prototypes. This project started in 1Q 2005. After several bug fixes in a half-year, we succeeded in brining up Tomcat on JESSICA2 (see Figure. 2 below); after another one-year work, Tomcat executes stably and can be subjected to intensive performance stress tests and analyses.

¡@

Figure 2. Screenshot of default page of Tomcat 3.2.4 on JESSICA2

¡@

Application Benchmarks

We found three typical servlet-based web applications on the web that are very useful for evaluating our system:

MySQL database server is used in these benchmarks.

¡@

Figure 3. Screenshot of an online bookstore web application modified from TPC-W benchmark, running atop Tomcat on JESSICA2

¡@

However, today¡¦s web application workloads are becoming more and more dynamic and heavy especially in those enterprise services. Web services have emerged as a standard for web application integration. So our benchmarks should also have web service workloads. Many compute-intensive or memory-demanding operations like dynamic page generation, XML parsing, object binding and security operations such as hashing and encryption are involved. We believe these are favorable workloads that allow DJVM-based clustering to achieve a good speedup for enterprise web services. In order to verify this, supporting Tomcat alone is not enough. We also need to support a SOAP engine. We see that Apache SOAP (now called Axis), an open-source implementation of W3C SOAP protocol, is a popular choice. It runs on top of Tomcat to support Java web services. Since there are few web service benchmarks available for our testing, we have built our owns. Also, we need some applications with object caching to demonstrate the strength of cooperative caching in JESSICA2.

¡@

The list of our developed benchmark applications is as follows:

(Source codes of these application benchmarks will be available for download soon ...)

¡@

¡@

Software Download (Coming Soon ...)

¡@

Project Members

Supervisor: Dr. Cho-Li Wang
Research Students: King Tin Lam
Luo Yang, James

               

If you are interested in this project and wish to know more details, please contact King Tin Lam on ktlam@cs.hku.hk or Dr. Cho-Li Wang on clwang@cs.hku.hk.

¡@

 

Publication

¡@

Related Links

 


Site Stats