The present invention relates to computer software and more particularly to methods, systems, computer program products, and methods of doing business whereby programmatically-generated bytecode insertion is used to perform run-time analysis of performance of remote method invocations.
Object oriented and bytecode based software development platforms, including Sun Microsystems's Java and Microsoft's NET platform, have gained wide acceptance for developing Internet and Enterprise class software applications. Bytecode based software provides cross-platform and cross-language compatibility and eases the networked integration of software applications.
The above platforms further provide frameworks, including Sun Microsystems's RMI and Microsoft's NET Remoting, for invoking methods of remote objects and computers transparently. Remote method invocation frameworks hide the complexity and mechanics for preparing request and response messages, serializing arguments and return values, setting up and managing network connections, transporting the message over network links, and dispatching method invocations based on the request message. While the frameworks greatly simplify programming remote method invocations and stow away complexity, programmers frequently oversee costly usage of said remote invocations, causing poor performance and scalability.
Application performance is often a critical business factor and as such subject to optimization. Remote method invocations can significantly contribute to poor performance. Therefore, monitoring and diagnosing performance of remote method invocations is required to optimize source code, software architecture, and configuration of networked software applications.
There are several known types of monitoring remote method invocations. One of them is sniffing packets at the network level. Such network sniffing tools see due to their nature applications as a black-box and consequently lack application context information, which is required to relate remote method invocations to application internals. Another limitation of network sniffers is that they cannot alter the remote method invocations message, which prevents adding trace tags to the remote method invocation message. Also network sniffers cannot see remote method invocations if they are sent over encrypted communication channels.
Another type of monitoring tool is based on remote management protocols, including but not limited to SNMP, JMX, WBEM. Such remote management protocols are used to query aggregated performance information by use of monitoring agents. Monitoring agents require source code modifications for instrumenting the application. Due to the generic nature, performance metrics provided through such management interfaces are aggregated over different types and occurrences of remote method invocations. Furthermore, available performance metrics are pre-built into the application and cannot be changed at run-time. These metrics cannot be associated to particular application transactions that are on-the fly.
Another known type of monitoring remote method invocations is to enable remote method invocation logging of said application development frameworks. These log messages are intended for diagnosing remote method invocation errors rather than for diagnosing remote method invocation performance. As such, they lack required performance information including but not limited to message size, serialization cost information. Furthermore, log events are restricted to built-in events of the applications runtime platform.
A manual approach to capturing performance information of remote invocation calls is to add generation of log messages to the application source code. Modifying application source code requires deep programming and performance measurement knowledge, which may not be available in all situations where performance measurement is required. Altering the source code can introduce undesired application defects. Furthermore, access to source code is often not available. Altered source code of applications must be recompiled and redeployed. Redeployment may also require an undesired restart of the application, which in turn may increase application downtime.
Accordingly, a need exists for overcoming these shortcomings of the prior art.
The present invention is directed to a system and method for capturing performance metrics of distinct remote method invocations in networked software applications to enable performance diagnosis and performance bottleneck root-cause analysis in production and load test environments. Its objective is to capture the performance metrics for single remote method calls.
The present invention captures the performance metrics in a manner that provides minimal disruption to the execution characteristics of the application.
The present invention does not require access to source code for capturing remote method invocation performance metrics from bytecode based software applications.
Another object of the present invention is to provide techniques for programmatically instrumenting the bytecode of applications during load-time and run-time so that performance metrics about distinct remote method invocations will be captured.
The above performance metrics preferably include but are not limited to bytes send, bytes received, objects serialized, objects deserialized, objects visited for serialization, objects visited for deserialization, remote method invocation response time at the stub, remote method invocation response time at the dispatcher.
Instrumenting software applications for the purpose of performance diagnosing remote method invocations using a first method preferably includes: intercepting load requests for original bytecode at run-time; programmatically altering original bytecode by inserting additional bytecode (the altered and added bytecode is further called sensors) to identified methods; loading for each intercepted load request the altered bytecode in place of the original bytecode.
Alternatively, instrumenting software applications for the purpose of performance diagnosing remote method invocations using a second method preferably includes: loading original bytecode at run-time; programmatically altering loaded original bytecode by inserting additional bytecode to methods that implement remote method invocation interfaces; and to methods that send/receive remote method invocation over network streams; and to methods that serialize/deserialize objects; redefining original bytecode by altered bytecode at run-time.
When instrumented remote methods are invoked, the altered bytecode (sensors) gets an existing or creates a new remote performance diagnostics thread-local-storage (RPD-TLS) object for the current thread in which the method is running. A thread-local-storage object is a global variable, of which the accessibility scope is restricted to the single thread in which it has been created, allowing multiple threads to create their own copy of the same variable type. The RPD-TLS object preferably includes variables for holding performance metrics; variables for correlating the invoked method with the message send/receive streams, variables for correlating the invoked method with serialization/deserialization streams, variables for control and status information.
During the execution of the remote method call, the altered bytecode (sensors) collects performance metrics and writes them to the RPD-TLS of the current thread. The RPD-TLS may contain further control and status information that sensors can evaluate and use to change behavior and method call correlation.
On completion of the remote method invocation, the collected performance metrics are preferably stored for further analysis. Storing performance metrics may include transfer over network connections, writing to file, and storing in memory.
The technique may further include selectively deactivating performance measurement of one or more instrumented remote method invocations.
Capturing performance information of remote method invocations may occur on client as well as on the server side of the remote communication.
Historically, it has been difficult to provide tools to diagnose the root-cause for poor performing remote invocation calls, since most existing tools rely on network based information, which lack an application context. The present invention, on the other hand, discloses a relatively lightweight approach to diagnosing the performance of remote method invocations, which is applicable also in load-testing and production scenarios.
In the Java platform's distributed object model, a remote object is one whose methods can be invoked from another Java virtual machine, potentially on a different host. An object of this type is described by one or more remote interfaces which are interfaces written in the Java programming language that declare the methods of the remote object.
Remote method invocation (RMI) is the action of invoking a method of a remote interface on a remote object. Most importantly, a method invocation on a remote object has the same syntax as a method invocation on a local object.
Referring now to
The exemplary embodiment describes remoting performance diagnostics using Java RMI/JRMP terminology. The present invention is not limited to Java RMI/JRMP and may be applied to other remote invocation methods that are based on bytecode execution including but not limited to Java Web Services, JMS, NET remoting.
Client applications 101 may use threads to perform remote method invocations concurrently. Server applications 106 use typically thread pools to accept and dispatch remote method invocations concurrently. Server applications 106 will serialize remote method invocations in case the maximum number of dispatcher threads has been reached. On the server application 106 side, when a client application 101 connects to the server socket, a new thread is forked to deal with the incoming call. The original thread can continue listening to the original socket so that additional calls from other clients can be made.
The stub 102 hides the serialization of parameters and the network-level communication in order to present a simple invocation mechanism to the caller.
Referring to
Referring to
Serialization is defined as the process of deconstructing objects with variables and references to other objects and to a serial stream of objects and primitive type values. Deserialization is defined as the reconstruction of a stream of objects and primitive type values to a single object.
Marshalling is defined as the process of encoding an object and primitive type values to a byte sequence for transport and persistency. Unmarshalling is defined as the process of decoding a byte sequence to objects and primitive type values.
The sensors 201, 202, 203 that are injected into the original bytecode by the instrumentation engine 204 are can be categorized into three types. The three types of sensors are shown in
Referring to
The remote method invocation sensor bytecode at the exit points of the methods preferably performs following operations (also shown in
The instrumentation engine preferably places further transport sensor bytecode into the remote method invocation transport stream for capturing read bytes and sent bytes. The transport sensor bytecode preferably performs operations shown in
The instrumentation engine 204 preferably places further serialization sensor type bytecode into the object (de)serialization and (un)marshalling methods. The preferred operations this serialization sensor bytecode performs is shown in
The present invention may be further extended to provide metrics about each serialized object for pinpointing the most expensive object of the serialization process.
The present invention claims priority under 35 USC section 119 based on provisional application Ser. No. 60/597,576 filed on Dec. 12, 2005.
Number | Name | Date | Kind |
---|---|---|---|
5432932 | Chen et al. | Jul 1995 | A |
5727147 | van Hoff | Mar 1998 | A |
5781778 | Meier et al. | Jul 1998 | A |
5794046 | Meier et al. | Aug 1998 | A |
5867712 | Shaw et al. | Feb 1999 | A |
5933639 | Meier et al. | Aug 1999 | A |
5953530 | Rishi et al. | Sep 1999 | A |
6101524 | Choi et al. | Aug 2000 | A |
6102966 | Tyma | Aug 2000 | A |
6134603 | Jones et al. | Oct 2000 | A |
6145121 | Levy et al. | Nov 2000 | A |
6151639 | Tucker et al. | Nov 2000 | A |
6202199 | Wygodny et al. | Mar 2001 | B1 |
6332212 | Organ et al. | Dec 2001 | B1 |
6721941 | Morshed et al. | Apr 2004 | B1 |
6760903 | Morshed et al. | Jul 2004 | B1 |
6795962 | Hanson | Sep 2004 | B1 |
6862711 | Bahrs et al. | Mar 2005 | B1 |
6961926 | Koyama | Nov 2005 | B2 |
6968540 | Beck | Nov 2005 | B2 |
7124404 | Bebout et al. | Oct 2006 | B1 |
7162710 | Edwards et al. | Jan 2007 | B1 |
7237230 | Underseth et al. | Jun 2007 | B2 |
7263689 | Edwards et al. | Aug 2007 | B1 |
7293259 | Dmitriev | Nov 2007 | B1 |
7293260 | Dmitriev | Nov 2007 | B1 |
7367025 | Nikolov et al. | Apr 2008 | B1 |
7376940 | Bush | May 2008 | B1 |
7496903 | Rees | Feb 2009 | B2 |
7500227 | Fontana et al. | Mar 2009 | B1 |
7506315 | Kabadiyski et al. | Mar 2009 | B1 |
7552424 | Bischof et al. | Jun 2009 | B1 |
7634759 | Calsyn et al. | Dec 2009 | B2 |
7647589 | Dobrovolskiy et al. | Jan 2010 | B1 |
7739661 | Garzia et al. | Jun 2010 | B2 |
7818721 | Sundararajan | Oct 2010 | B2 |
20010004766 | Koyama | Jun 2001 | A1 |
20020032754 | Logston et al. | Mar 2002 | A1 |
20020174415 | Hines | Nov 2002 | A1 |
20020199173 | Bowen | Dec 2002 | A1 |
20030056200 | Li et al. | Mar 2003 | A1 |
20040010570 | Kaler et al. | Jan 2004 | A1 |
20040093588 | Gschwind et al. | May 2004 | A1 |
20050039171 | Avakian et al. | Feb 2005 | A1 |
20050039172 | Rees et al. | Feb 2005 | A1 |
20050039186 | Borkan | Feb 2005 | A1 |
20050039187 | Avakian et al. | Feb 2005 | A1 |
20050039190 | Rees et al. | Feb 2005 | A1 |
20050086656 | Whitlock | Apr 2005 | A1 |
20050223367 | Smith et al. | Oct 2005 | A1 |
20050278706 | Garza et al. | Dec 2005 | A1 |
20060069682 | Fanous et al. | Mar 2006 | A1 |
20060242627 | Wygodny et al. | Oct 2006 | A1 |
20060271395 | Harris et al. | Nov 2006 | A1 |
20060271542 | Harris et al. | Nov 2006 | A1 |
20060271575 | Harris et al. | Nov 2006 | A1 |
20060271930 | Letizi et al. | Nov 2006 | A1 |
20060271931 | Harris et al. | Nov 2006 | A1 |
20070006165 | Lam et al. | Jan 2007 | A1 |
20070011667 | Subbiah et al. | Jan 2007 | A1 |
20070069005 | Dickerson et al. | Mar 2007 | A1 |
20070088762 | Harris et al. | Apr 2007 | A1 |
20070143323 | Vanrenen et al. | Jun 2007 | A1 |
20070143743 | Cobb et al. | Jun 2007 | A1 |
20070169055 | Greifeneder | Jul 2007 | A1 |
20070180439 | Sundararajan | Aug 2007 | A1 |
Entry |
---|
Parker Abercrombie et al. , “jContractor: Bytecode Instrumentation Techniques for Implementing Design by Contract in Java”, UCSB , Aug. 2004 , <http://jcontractor.sourceforge.net/doc/Contractor—RV02.pdf> pp. 1-25. |
Mikhail Dmitriev , “Selective Profiling of Java Applications Using Dynamic Bytecode Instrumentation”, IEEE , 2004 , <http://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=1291366> pp. 141-151. |
Mikhail Dmitriev , “Design of JFluid: A Profiling Technology and Tool Based on Dynamic Bytecode Instrumentation” , Sun Microsystems , 2003 , <http://delivery.acm.org/10.1145/1700000/1698171/smli—tr-2003-125.pdf> pp. 1-22. |
Genady Beryozkin , “RMI Plug-in for Eclipse version 2.0”, RMI , May 20, 2006 , <http://www.genady.net/rmi/v20/docs/spy/spy—effects.html> , pp. 1-3. |
Grigore Rosu et al. , “An Instrumentation Technique for Online Analysis of Multithreaded Programs”, IEEE , 2004 , <http://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=1303344> pp. 1-8. |
Mick Jordan et al. , “Proceedings of the Second International Workshop on Persistence and Java” , Sun Microsystems , Dec. 1997 , <http://delivery.acm.org/10.1145/980000/974967/smli—tr-97-63.pdf> , pp. 1-177. |
Number | Date | Country | |
---|---|---|---|
20070169055 A1 | Jul 2007 | US |
Number | Date | Country | |
---|---|---|---|
60597576 | Dec 2005 | US |