Previous Next Contents Index


Chapter 7

Increasing Fault Tolerance and Server Resources

This chapter describes increasing Netscape Application Server resources, which can increase application performance.

The following topics are included in this chapter:

Increasing Netscape Application Server (NAS) resources, such as number of threads, number of processes, and number of restart attempts can increase the performance of the applications running on the server and reduce the likelihood of application downtime.

When planning how to increase server resources, you must take into account the resources of the NAS machine. For instance, if the machine is not capable of handling additional processes, you can negatively affect the performance of an application by increasing the number of processes running on that machine. Likewise, assigning additional threads to a process removes available threads from the system-wide thread pool, limiting the system's ability to process other thread-utilizing requests, such as database access.


Adding and Tuning Java Server and C++ Server Processes
You can add a Java Server (KJS) or C++ Server (KCS) process to increase fault tolerance. By having one or two additional processes, an application is more likely to respond to users' requests. If one process fails, for instance, the second or third process can take its place, decreasing the amount of time an application is unavailable. This is particularly useful for applications that have known problems that can cause a process to fail.

Add more KJS processes for Java applications and add more KCS processes for C++ applications. It is usually not necessary to add more than two processes for each type of application, Java and C++. If an application cannot run on one or two processes, there are most likely errors in the code that are causing the processes to fail. Those errors should be addressed by the application developer.

To add a Java Server or C++ process, perform the following steps:

  1. On the NAS Administrator toolbar, click the General button to open the General window.
  2. In the left pane of the General window, select the NAS machine where you want to add the KJS process.
  3. From the File menu, choose New, then Process.
  4. In the Process drop-down box, choose KJS or KCS.
  5. In the Port Number text box, specify an unused port number where the additional process will run.
  6. Click OK to dismiss the dialog box.
  7. If this process is to be used in a single-threaded environment, perform the following steps:
    1. Click the process in the left pane of the General window.
    2. In the right pane of the window, set the Default Minimum and Default Maximum Threads to 1.

  8. Click the Apply Changes button to save your changes.

Adjusting the Number of Threads for a Process
Request threads handle users' requests for application components. When NAS receives a request, the application server assigns the request to a free thread. The thread manages the system needs of the request. For example, if the request needs to use a system resource that is currently busy, the thread waits until that resource is free. When the resource is free, the thread allows the request to use that resource.

You can specify the minimum and maximum number of threads that are reserved for requests from applications. The thread pool is dynamically adjusted between those two values. The minimum thread value you specify holds at least that many threads in reserve for application requests. That number is increased up to the maximum thread value you specify on an as-needed basis.

Increasing the number of threads available to a process to allow that process to respond to more application requests simultaneously. Threads can be added to a process at the process level, or globally at the NAS level.

By default, each process uses the threads assigned to NAS. For example, if NAS uses a minimum of 8 threads and a maximum of 64 threads, each individual process uses a minimum of 8 threads and a maximum of 64 threads.

To adjust the number of request threads for all (KJS/KCS/KXS) processes, perform the following steps:

  1. On the NAS Administrator toolbar, click the General button to open the General window.
  2. In the left pane of the General window, select the server whose number of threads you want to adjust.
  3. In the Default Minimum Threads text box, enter the minimum number of threads available for the Java Server (KJS), C++ Server (KCS), and Executive Server (KXS) processes of the selected NAS machine.
  4. In the Default Maximum Threads text box, enter the maximum number of threads available for the KJS, KCS, and KXS processes of the selected NAS machine.
  5. Click Apply Changes to save your changes.
You can also customize the usage of threads for each process. Once you do this, however, the number you set globally at the NAS level is overridden by the number you set at the process level.

To adjust the number of threads available for individual processes (KJS, KCS, and KXS), perform the following steps:

  1. On the NAS Administrator toolbar, click the General button to open the General window.
  2. In the left pane of the General window, select the process whose number of threads you want to adjust.
  3. In the Default Minimum Threads text box, enter the minimum number of threads available for that process.
  4. In the Default Maximum Threads text box, enter the maximum number of threads available for that process.
  5. Click Apply Changes to save your changes.

Adjusting the Restart Option of the Administrative Server
Adjust the restart option of the Administrative Server to increase or decrease the number of times the Administrative Server attempts to restart an Executive Server (KXS), Java Server (KJS), or C++ Server (KCS) process that has failed. This option increases fault tolerance and application availability by attempting to ensure that all processes are running.

The Administrative Server is the administrative process within NAS through which administrative tasks are processed.

To adjust the restart option of the Administrative Server, perform the following tasks:

  1. On the NAS Administrator toolbar, click the General button to open the General window.
  2. In the left pane of the General window, select the NAS machine whose you Administrative Server restart option you want to adjust.
  3. In the right pane of the General window, in the Maximum Number of Restarts text field, enter the new value.
  4. Click Apply Changes to save your changes.

Implementing a Multi-Process, Single-Threaded Environment
You can add a Java Server (KJS) or C++ Server (KCS) process to implement a multi-process, single-threaded environment. Running multiple KJS processes, all in single-threaded request mode, effectively creates a "multi-threaded" environment, which allows simultaneous processing of users' requests.

Implementing a multi-process, single-threaded environment allows each process to accept only one request at a time. This is useful when you are integrating third-party utilities. Running third-party utilities in the NAS multi-threaded request environment can cause errors beyond the control of the application server, including thread safety issues. To work around this type of problem and still allow the Netscape Application Server (NAS) to scale, you can implement a multi-process, single-threaded environment.

For example, if a third-party utility runs within the KJS process, but this utility is not thread safe, you can adjust the request threads of the KJS to 1 and eliminate the utilitiy's safety issues. However, this creates a request backlog as requests wait for the KJS to process a single request at a time. To alleviate that problem, you can run multiple KJS processes, all running in single-threaded request mode, and effectively create a "multi-threaded" environment allowing simultaneous processing of users' requests.

You do need to maintain multiple request threads for the Executive Server (KXS) process, as it distributes all requests that come into NAS.

To implement a multi-process, single-threaded environment, perform the following tasks:

  1. Add KJS or KCS processes.
  2. Adjust the request threads allocated for those processes to 1.

Configuring Directory Server Failover
The Directory Server connected to your Netscape Application Server (NAS) machine contains global information shared by all application servers in a Directory Server cluster. A Directory Server cluster is simply one or more NAS machines that share a single Directory Server. To protect this globally shared information, you must configure a second Directory Server to act as a backup if the primary server fails.

Before adding a backup Directory Server to your Directory Server cluster, you must replicate the NAS subtree of the primary Directory Server using supplier initiated replication (SIR). SIR is a replication configuration where servers containing master copies of directory trees and subtrees replicate directory data to servers containing replicated directory trees and subtrees.

The two copies of the NAS subtree must always be in sync with each other.

The NAS subtree is

cn=Global, cn=nasconfig, cn=NAScluster, o=NetscapeRoot 
where nasconfig is specified during installation.

For details and replication procedures, see "Managing Replication," a chapter in Netscape Directory Server Administrator's Guide. This document is installed with your installation of Directory Server in the following location:

NAS install directory/manual/en/slapd/ag/replicat.htm
Now add a backup Directory Server using the NAS Administrator tool by performing the following steps:

  1. On the NAS Administrator toolbar, click the General button to open the General window.
  2. In the General window, click the LDAP tab to display the following screen:
  3. To add a secondary Directory Server, click the Add button.
  4. Enter the new server's information.
  5. Click OK.
To remove a Directory Server, click Remove.

You must always have at least one Directory Server configured to work with NAS.

 

© Copyright 1999 Netscape Communications Corp.