Explanation of Example

Explanation of Example

[[wiki:VisiBroker Performance Tuning|Back]]

Download and Build

An example is created to demonstrate the thread and connection management behavior of VisiBroker. You can download the source code and script of the example from VisiBroker Performance Tuning Example

Please note that the source code contained in the example is strictly for illustrative purposes only.

The example archive contains two subfolders, namely "echo_service_cpp" and "echo_service_java" which contains the C++ and Java version of the example respectively. For simplicity, the scripts and makefiles packaged in the example only support VisiBroker 8.5 for Solaris 32-bits platform. Support for other platforms or VisiBroker versions will require adaptions.

First prepare the environment by running vbroker.sh in your VisiBroker installation "bin" directory. Ensure that the "make" utility (e.g. /usr/ccs/bin/make), "CC" (Sun Studio compiler) and "javac" (Java compiler) can be found in the PATH environment variable.

Then build the C++ example by running the make command in the "echo_service_cpp" folder:

  • make -f Makefile_cpp

Build the Java example by running the make command in the "echo_service_java" folder:

  • make -f Makefile_java

Functionality and running the Example 

Functionality

The IDL of the example is rather simple and defines only a single object with one method

module Tutorial {

interface EchoService {

string echo(in unsigned long time, in string tag);

};

};

The echo method will simply return the input string tag as a return value after the specified time in seconds. If time is a value greater than 0 the implementation will do idle waiting. If time is 0, some CPU/resource intensive operations are perform before tag is returned.

Run Client and Server 

To run the example two scripts are used, s.sh to start the server(s) and c.sh to start the client(s).

The client script has 3 parameters - c.sh m n p

  • m is the number of client process started
  • n is the number of servers called by each client
  • p is the number of threads a client uses to call a server. Each thread makes one call. In total there are n*p threads per client.

The server script has 1 parameter - s.sh p

  • p is the number of server process started

The server will write it's IOR to a file and the client will read the IOR and make invocations to the server. 

You may run the client and server in different machines provided the client is able to read the server IOR file from a shared drive. However for simplicity, the instructions given in these articles assumes you are running the client and server in the same machine.

Run Monitor scripts

The two monitor scripts, mon_c.sh and mon_s.sh, monitor the client and server process(es) respectively. They find all the related processes and print their memory consumption, number of threads and number of open sockets in regular intervals.

The following is an example of the output :

TIMESTAMP     PID     MEMORY(KB)  THREADS   SOCKETS

13:16:10      3862    12248       12        1

Ensure that your USER environment variable is set because the scripts only monitor the client and server processes started by a specific user Id.

In the next article we will make use this example to demonstrate how to capture and analyze the important stack traces of the client and server during invocations. 

[[wiki:VisiBroker Performance Tuning|Back]]  |  [[wiki:VisiBroker Threads|Next]]

Labels (1)

DISCLAIMER:

Some content on Community Tips & Information pages is not officially supported by Micro Focus. Please refer to our Terms of Use for more detail.
Top Contributors
Version history
Revision #:
2 of 2
Last update:
‎2020-03-13 21:06
Updated by:
 
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.