|
SYS-CON.TV Webcasts
Comments
Did you read today's front page stories & breaking news?
SYS-CON.TV
|
Top Links You Must Click On
Product Reviews Oracle JServer Scalability and Performance
Oracle JServer Scalability and Performance
By: Jeremy Lizt
Nov. 1, 1999 12:00 AM
As Java has evolved from the language of applets and JavaBeans to that of servlets, Enterprise JavaBeans and database stored procedures, a need has developed for a scalable Java platform. No longer are Java applications run only for a single user. Companies are now building enterprise-scale production systems using server-side Java technology, and these systems need to scale to serve tens ... often tens of thousands ... of concurrent users. Although many efforts have been made to enhance the JDK, Sun Microsystems' reference JVM implementation, Oracle pursued a different strategy as it set out in 1996 to develop an enterprise-scale, server-side Java Virtual Machine from the ground up. This effort manifested itself in the recent release of Oracle JServer, a 100% Java-compatible server environment supportive of Enterprise JavaBeans, CORBA servers and database stored procedures.
Challenges of Java Scalability
An application may be said to scale to n concurrent users when response time begins to bloat with the n + 1th user (see Figure 1). Once usage exceeds this threshold, it's preferable for system performance to degrade gracefully and linearly, rather than in an erratic, unpredictable manner. There are a number of central challenges in building a scalable Java platform. First, the server must provide an effective mechanism to handle multiple concurrent clients. The architecture of most JVMs forces application developers to implement their own scalability by writing multithreaded Java code. A JVM that professes to be a scalable Java server may claim to provide good support for Java language threads. Two fundamental problems impair this approach: the application developer is required to build in his or her own scalability (a difficult, error-prone task), and garbage collection on heavily threaded applications can be extremely inefficient. In a simple model in which each individual user maps to a Java language-level thread, a single garbage collector deals with all garbage from all users. The technique by which a JVM performs storage management, as well as the JVM architecture, determines the efficiency of garbage collection. The second challenge facing the Java server provider is optimizing storage management. One of Java's primary benefits to developers is that they need not expressly allocate and free memory. Automated memory management is the responsibility of the VM, and a poor garbage collection algorithm will diminish the scalability of a Java server. The third challenge in achieving platform scalability is minimizing the memory footprint consumed by each user of the system. The server will naturally be limited by the physical resources of the configuration, so the JVM must make the most efficient use of its available memory to maximize the number of clients it can serve. Many vendor implementations attempt to achieve scalability by spawning multiple instances of a JDK or similar JVM. This approach incurs substantial redundancy, however, contributing to a burdensome client footprint and restricting scalability. Finally, a Java server should execute code swiftly as a means to bolster scalability. An inefficient bytecode execution will uneconomically consume precious CPU, resulting in sluggish performance and degraded scalability potential. Common approaches to accelerating execution typically involve some sort of just-in-time (JIT) or dynamic native compilation of Java bytecodes.
Oracle JServer Architecture
Oracle JServer is tightly integrated with the Oracle8i database, and both share the notion of a client session. When a client initiates a session either through the SQL database or directly with JServer, it receives a single session within Oracle8i that comprises both a SQL database session and a JServer session. Each JServer session maintains its own Java state, which is not shared between sessions. Every client to JServer thereby perceives a dedicated JVM. Although many JVM implementation resources are shared between sessions (read-only bytecode information, for example), the experience of a JServer client is that of a devoted JVM. The client session, appearing to the client as a dedicated VM, can thus be regarded as a virtual virtual machine, or VVM (a model similar to that of a UNIX operation system) (see Figure 2). Oracle JServer was designed as a server-side Java platform, and it is specifically architected to address challenges of Java scalability. A fundamental advantage of the architecture is that it relieves the Java application developer of the need to write multithreaded server code. When developing for the JServer platform, a developer is encouraged to write the application for a single user. Scalability is achieved once the application is loaded into JServer. The virtual machine uses the multithreaded server facilities of the RDBMS to concurrently schedule Java execution, enabling thousands of clients to simultaneously access the application through independent JServer sessions. In addition to freeing the application developer to focus on his or her application code, the JServer architecture provides the related benefit of escaping the garbage collection bottlenecks that can hamper performance in multithreaded Java applications. JServer sessions, or VVMs, maintain independent memory stores and can be garbage-collected independently. JServer thereby enjoys a performance advantage because the burden and complexity of memory management doesn't increase as the number of users increases. The memory manager always deals with the allocation and collection of objects within a single session. The simplicity of this scenario welcomes the application of sophisticated allocation and collection schemes attuned to the types and lifetimes of objects. For example, new objects are allocated in fast and cheap call memory, designed for quick allocation and access. Objects held in Java static variables are migrated to more precious and expensive session memory. Different garbage collection algorithms are applied in the various memory areas, resulting in high efficiency and low overhead. Oracle JServer shares common read-only code and other appropriate data between its concurrent sessions. Only state variables unique to a session need to be stored privately for each VVM. Through this model JServer minimizes the memory footprint required to service its clients. Since its architecture scales comfortably to the capacity of its host machine, it never needs to spawn new JVM instances to serve additional users. Its shared memory model can therefore be leveraged over its full user population. Memory footprints for simple programs like hello, world require as little as 35K per concurrent user on JServer. This measurement compares favorably to analogous footprints exceeding 1M on servers that are forced to spawn additional JVMs. Oracle JServer addresses garbage collection, memory management and footprint challenges by means of its architecture. It confronts the execution performance challenge with its JServer Accelerator native compilation technology. In contrast to the JIT approach employed by many JVM implementations, the JServer Accelerator uses a WAT (way ahead of time) technique. As server code tends to be long-lived on its host machine, it's generally worthwhile to compile it into well-optimized native code. A WAT will invest more time in compilation than a JIT to produce more comprehensive optimizations.
ScaleServer Benchmark
Description
To test memory management and garbage collection efficiencies, the work method instantiates, holds and drops Java objects. The workload represents a typical conversational load with multiple concurrent, stateful sessions on the server. Clients are added until the load becomes unmanageable to the server. The benchmark clients measure the round-trip time between the issuance of a request and the receipt of a response from the server. (Note that no SQL database access is done in the benchmark.) Although swift SQL access is an inherent benefit of JServer's integration with the Oracle8i database, the ScaleServer benchmark is intended to produce a pure measure of a Java server's execution scalability.
Parameters
Results
To scale the test even further and evaluate Oracle JServer's ability to exploit even more sophisticated hardware architectures, the same tests were run with Oracle JServer on a Sun Enterprise E-6500 class machine with 12 Ultrasparc CPUs, 4GB of memory and 100GB of fast hot-swap Ultra SCSI internal storage. Results continued as predicted - JServer scaled to support over 5,000 concurrent users while providing very consistent and predictable response times.
Conclusions
A grave limitation of the HotSpot VM's performance was that it was able to leverage only about 15 to 20% of the E-450's CPUs. Thus, since CPU wasn't a constraining factor, HotSpot couldn't support additional clients by using additional CPUs. In contrast, JServer consistently scaled linearly up to the capacity of the hardware, exploiting the additional CPUs that were added as the test was scaled from a four-way to a 12-processor system. Naturally, the more processing a system does, the more it will benefit from running efficient code. While the HotSpot dynamic compiler may be effective for single-user applications, much of its benefit is unrealized in a multiuser environment. The Oracle JServer Accelerator compilation technology on the other hand produces excellent results in highly concurrent scenarios. JServer's compilation technology works very efficiently with the server's shared memory architecture to provide excellent performance under multiuser configurations.
Oracle JServer Qualifications
Summary and Benefits
In addition, its scalable architecture offers three fundamental benefits concerning the development, deployment and management of Java applications:
Reader Feedback: Page 1 of 1
Enterprise Open Source Magazine Latest Stories . . .
Subscribe to the World's Most Powerful Newsletters
Subscribe to Our Rss Feeds & Get Your SYS-CON News Live!
|
SYS-CON Featured Whitepapers
Most Read This Week |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||