CORBA 2.6.1 Programmer's Guide for C++

Chapter 6. Writing Scalable Applications
Chapter 6. Writing Scalable Applications
Overview of Scalability Choices
Using Stateless Objects and Server Pools
Writing Your Application to Use Server Pools
Stateful and Stateless Objects
State Policy
Using Stateless Factory Objects to Create Stateful Servants
Adjusting TS/MP Configuration Parameters
Using Parallel Library TCP/IP
Increasing the Number of Comm Server Processes
Using Multiple Instances of NonStop TCP/IP
Using Multithreaded Servers
As applications increase in size, NonStop CORBA provides a number of ways to accommodate this growth. This section describes how to use
the features of NonStop CORBA and the underlying NonStop systems to support larger applications, decrease response time, and increase
throughput.
Certain scalability functions are taken care of automatically by the NonStop CORBA ORB. For example, new local or remote clients can connect
to the ORB with no configuration changes required on the NonStop system. Parts of the ORB, including communications processes, the Naming
Service, and the Transaction Service implementation (NSOTS), use TS/MP to provide scalability features, including load balancing and
automatic starting of new processes as needed.
You can use other scalability features by adjusting your configuration and making programming changes in various ways, as described in this
section.
The server portion of the Bank sample program provides an example of a highly scalable stateless servant for a database object. For details,
refer to the
corba-server subdirectory within that sample.
Overview of Scalability Choices
The following is a list of things you can do to increase the capacity, throughput, and response time of your NonStop CORBA applications:
Design your application to use stateless objects, which allow NonStop CORBA to scale your application automatically through the use of
TS/MP.
Configure application server processes as server pools. NonStop CORBA then uses the capabilities of TS/MP to spread the workload
among multiple processes, adds new processes as needed, and provides load balancing.
Configure the Comm Server, LSD, ILSD, and/or BSD processes in your NonStop CORBA system to use Parallel Library TCP/IP, so that
a single TCP/IP port is shared by multiple communications processes.
Increase the number of Comm Server processes to support increased request traffic.
Add multiple instances of NonStop TCP/IP to the NonStop CORBA system to provide additional external port connections.
If your application performs thread-blocking operations, write a multithreaded server to increase the number of threads per process.
Using Stateless Objects and Server Pools
NonStop CORBA uses TS/MP server pools (called server classes in TS/MP documentation) internally for many of its own processes. In
addition, you can write your own applications to take advantage of server pools. A server pool lets your application scale across processes to
increase capacity. It also increases throughput by creating new server processes when existing ones are blocked by process-blocking
operations, such as access to databases.
To obtain the scalability and throughput advantages of server pools, you must write your applications to use stateless objects. You can address
a stateless object within a server pool with a single object reference, as if it were one logical object, regardless which server process it resides
in. This capability gives server pools an advantage over multiple stand-alone servers.
Writing Your Application to Use Server Pools
To use server pools, you do the following in your application:
In profile@ORB for the server, set tsmp_server to true and specify a PATHMON process name and a server-class name.