Share via


Defining a Server

   

Server definition is a significant part of APE modeling. This is where you choose pooling and queuing, configure the workers, and define the resource consumption characteristics of the services.

Pooling is an important design strategy because it quickly recycles objects that have already been created. Queuing is also important because with queuing your application handle increased workloads while balancing resource consumption. You can select pooling only, or both queuing and pooling together (for asynchronous models only).

You can configure the worker options using the following four parameters.

  • Number of Workers   As previously indicated, this is only relevant for the Asynchronous Queue model. It determines the number of worker objects that are "pre-instantiated" by the queue.

  • **Early Bind Services   **Object controllers can bind to object interfaces in one of two ways: late binding using the IDispatch mechanism or early binding using a vTable. In general, object variables that are dimensioned "As Object" are late bound: each method or property address is looked up at run time. Object variables that can take advantage of type libraries and be dimensioned as specific object types (for instance, "As Worksheet") at compile time are said to be early bound. Early binding offers a number of advantages, the most important of which is substantially better performance.

  • Retain Service References   In many object models, an object is created, used, and destroyed each time it is called. The Retain Service References option allows the worker to keep the service object in memory for repeated calls against the same object. This is most useful in the queue manager model. In the Direct model, this option only has an effect if the number of calls (set on the Clients tab) is greater than one.

  • Preload Services   Workers are created in the Queue Manager model before any Client requests are processed. This option forces the Worker, when instantiated, to load its corresponding Service. Setting this option eliminates this overhead from the performance log.

The CPU task option simulates real work by specifying task and sleep duration. You can investigate CPU availability by adjusting the CPU task workload on server machines.

Regardless of the work simulation determined by these settings, the only "real" work performed by APE's built-in service components is to return the data requested by the client. For more accurate measurement, you can substitute your own object method as a service. To do this, you specify a string of the form "Library.Class.Method", where Library is typically the name of your object server, Class corresponds to one of its publicly exposed object classes, and Method is any method implemented by the Class that requires no parameters.