Application Delivery Management
Application Modernization & Connectivity
IT Operations Management
CyberRes
[[wiki:VisiBroker Performance Tuning|Back]]
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:
Build the Java example by running the make command in the "echo_service_java" folder:
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.
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
The server script has 1 parameter - s.sh p
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.
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]]