RPC



 

Sample Applications that test the Difference in Performance between Distinct ONC RPC / XDR for Java and RMI


Many of our users have asked for information regarding the difference in performance of RMI versus Distinct Java RPC. For this reason we have done some testing that illustrates the difference.

The results show that on average applications developed using Distinct ONC RPC/XDR for Java returned their calls 40-50% faster than the same call made in an RMI application.

The samples we provide come in two directories, one called RMI and one called JRPC. The RMI subdirectory includes the samples written in RMI and the JRPC subdirectory includes the same samples written using the Distinct ONC RPC/XDR for Java Toolkit. First we show you how to set up the RMI test by running the client and server parts of the test, then we do this for the exact same sample using Distinct Java RPC.

SAMPLE TO TEST RMI PERFORMANCE

The sample is comprised of a client and server. To run this sample you must first install and run the server on a host such as a Sun system or a Microsoft Windows system.

STARTING THE SERVER
Below we provide instructions for running the server on a Sun Solaris or Microsoft Windows system.

Running the Server off a Sun Solaris system
The following instructions should let you quickly run this sample application. To install the server on Solaris place the program files in /home/test/rmi, then follow these instructions:

1. Change the current directory to: /home/test/rmi
2. You then need to start RMIs registry. However, before you do this you must make sure that the shell or window in which you will run rmiregistry either has no CLASSPATH environment variable set or has a CLASSPATH environment variable that does not include the path to any classes, including the stubs. To unset the classpath call:

unsetenv CLASSPATH

To start the rmiregistry enter:

rmiregistry &

Next set the classpath:
setenv CLASSPATH ./:/home/jrpc/
3. Now you are ready to start the server on the same host that you have started the registry:

java -Djava.rmi.server.codebase=file:/home/test/rmi/ -Djava.rmi.server.hostname=hostname RMIServer RMIServer bound

where hostname is the name of the host that is running this server.

Running the RMI server on a Microsoft Windows system
Copy the program files to C:Program Filestestrmi, then follow these steps:

1. Change the current directory to c:Program Filestestrmi
2. You then need to start RMIs registry. However, before you do this you must make sure that the shell or window in which you will run rmiregistry either has no CLASSPATH environment variable set or has a CLASSPATH environment variable that does not include the path to any classes, including the stubs. To unset the classpath call:

set CLASSPATH=

To start the rmiregistry enter:

start rmiregistry

Next set the classpath: set CLASSPATH=.;C:jrpc
3.Now you are ready to start the server on the same host that you have started the registry:

java -Djava.rmi.server.codebase=file:/C:Progra~1testrmi/ -Djava.rmi.server.hostname=hostname RMIServer RMIServer bound

where hostname is the name of the host that is running this server.
Once the registry and the server are running you are ready to start the client.

STARTING THE CLIENT

SYNTAX:

java [RMI options] RMIClient server "message" [count]

Running the Client on a Sun Solaris System

Copy all the program files to the /home/test/rmi directory. Then in the C Shell:

1. Change the current directory to /home/test/rmi.
2. Set the classpath:
setenv CLASSPATH ./:/home/jrpc/
3. Start the RMI client:
java -Djava.rmi.server.codebase=file:/home/test/rmi/ RMIClient

java RMIClient server "message" [count]
where:
server - hostname for RMIServer
message - message to be sent to server
count - repeating times to send message, default 1000

The server returns the average time that each client call takes. The first time shows the time taken by the server to receive only a message and the second shows the time it took to compute the MD5 hash for the message.

Example:

java -Djava.rmi.server.codebase=file:/home/test/rmi/ RMIClient hostname 'Hello World!' 5000

where hostname is the name of the machine that is running the server

this command should output:

Only send message to server: OK
Average time for each call: 8.1458 ms
Get MD5 hash for message from server: ED076287532E86365E841E92BFC50D8C
Average time for each call: 9.4476 ms
(note that the time may vary depending on your network traffic)


Running the Client on a Microsoft Windows System

Copy the program files to: C:testrmi

1. Change the current directory to c:testrmi.
2. Set the classpath:
set CLASSPATH=.;C:jrpc
3. Start the RMI client:

java -Djava.rmi.server.codebase=file:/C:testrmi/ RMIClient hostname
"Hello World!" 5000

where hostname is the name of the machine that is running the server

This command should output:
Only send message to server: OK
Average time for each call: 8.1458 ms
Get MD5 hash for message from server: ED076287532E86365E841E92BFC50D8C
Average time for each call: 9.4476 ms
(note that the time may vary depending on your network traffic)


TEST JRPC PERFORMANCE
The Distinct Jvav RPC server and client test applications are located in the "jrpc" directory. Below, we illustrate how to run this test assuming that you will be installing it on either a Sun Solaris system or a Microsoft Windows system.

Running the MD5Server on Sun Solaris

Copy the Distinct JRPC program files to /home/test/jrpc and make sure you have installed Distinct ONC RPC/XDR toolkit for Java (trial or actual version) on your system (we assume here that you installed it under /home/jrpc. Then:

1. Change the current directory to:
/home/test/jrpc
2. Set the classpath:
setenv CLASSPATH ./:/home/jrpc/
3. Run the server
java MD5Server


Running the MD5Server on Microsoft Windows

We assume that you have installed the Distinct ONC RPC/XDR Toolkit for Java in C:jrpc and the test programs are in C:testjrpc. Then:

Windows (Distinct JRPC in C:jrpc and test programs in C:testjrpc):
1. Change the current directory to:
C:\testjrpc
2. Set the classpath:
set CLASSPATH=.;C:jrpc
3. Run the server
java MD5Server

Once the server is running you need to start the client.

Running the MD5Client on a Sun Solaris System

We assume that you have installed the Distinct ONC RPC/XDR Toolkit for Java on /home/jrpc and have copied the test program files to /home/test/jrpc. Then:

1. Change the current directory to /home/test/jrpc.
2. Set the classpath:
setenv CLASSPATH ./:/home/jrpc/
3. Run the client
java MD5Client server "message" [count]
where:
server - hostname for MD5Server
message - message to be sent to server
count - repeating times to send message, default 1000
The server returns the average time that each client call takes. The first time shows the time taken by the server to receive only a message and the second shows the time it took to compute the MD5 hash for the message. Example:
java MD5Client sun 'Hello World!' 5000

where sun is the name of the server that is running the server application


This should cause the following output:
Only send message to server: OK
Average time for each call: 4.2114 ms
Get MD5 hash for message from server: ED076287532E86365E841E92BFC50D8C
Average time for each call: 5.7102 ms
(note the time may vary slightly depending on your network traffic)


Running the MD5Client on a Microsoft Windows System

We assume that you have installed the Distnct ONC RPC/XDR Toolkit for Java in C:\jrpc and the test program files in C:\test\jrpc. Then:

1. Change the current directory to:
c:\test\jrpc
2. Set the classpath:
set CLASSPATH=.\;C:\jrpc\
3. Run the client application"
java MD5Client hostname "Hello World!" 5000

where hostname is the name of the server that is running the server application

This command should output:
Only send message to server: OK
Average time for each call: 4.2114 ms
Get MD5 hash for message from server: ED076287532E86365E841E92BFC50D8C
Average time for each call: 5.7102 ms


(note the time may vary slightly depending on your network traffic)






Browse FAQ

Related Products
ONC RPC / XDR for C/C++
ONC RPC / XDR for C/C++ 64-bit
ONC RPC / XDR for IPv6 networks
ONC RPC / XDR for .NET

100% Pure Java Distinct RPC Toolkit was awarded 100% Java Certification by Sun Microsystems signifying true cross platform capability of distributed applications. "We are thrilled that Distinct has chosen to provide the market with a 100% Pure Java version of their ONC RPC/XDR Toolkit," said George Paolini, director of corporate marketing at Sun Microsystems Java Software Division". 

Quote

"Our evaluation has completed successfully.  We are satisfied that the product meets our current requirement and have recommended purchase.  We found the API well designed and very straightforward to use."
Paul Mapstone, Tokyo-Mitsubishi International

Who uses RPC:

Motorola
EMC Corp.
Spring Tide Networks
AT&T Wireless
Analog Devices
E*Trade UK
Scientific Atlanta
Ericsson
Ernst & Young
Boeing
Qualcomm
IBM
TCI
General Instruments
US Army TACOM
Jet Propulsion Labs
Lucent
Nortel
DST Innovis
and many others
06/24/2017   Legal notices | PRIVACY Policy |