Taking engines offline with dbcc engine

You can dynamically change the number of engines in use by Adaptive Server with the dbcc engine command to take an engine offline or bring an engine online. This allows a System Administrator to reconfigure CPU resources as processing requirements fluctuate over time.

Two configuration parameters limit the number of engines available to the server:

Due to the operating system limit on the number of file descriptors per process, reducing the number of engines reduces the number of network connections that the server can have.

There is no way to migrate a network connection created for server-to-server remote procedure calls, for example, connections to Replication Server and XP Server, so you cannot take an engine offline that is managing one of these connections.


dbcc engine syntax and usage

The syntax for dbcc engine is:

dbcc engine(offline , [enginenum] )
dbcc engine("online")

If enginenum is not specified, the highest-numbered engine is taken offline.

Depending on your operating system and the load on Adaptive Server, taking an engine offline can take several minutes. To complete the task of taking an engine offline, the following steps must be completed:

If tasks cannot be migrated within approximately 5 minutes, the tasks are killed.

WARNING! If you use dbcc engine(offline) when CPU utilization is high on the server, Adaptive Server may not be able to migrate all tasks before the time limit expires.Tasks that cannot be migrated within the time limit are killed.


Status and messages during dbcc engine(offline)

When a System Administrator issues a dbcc engine(offline) command, messages are sent to the error log. For example, these are the messages on Sun Solaris:

00:00000:00000:1999/04/08 15:09:01.13 kernel  engine 5, os pid 19441  offline

dbcc engine(offline) returns immediately; you must monitor the error log or check the engine status in sysengines to know that the offline-engine task completes.

An engine with open network connections using Client Library cannot be taken offline. Attempting to offline the engine reports this message in the error log:

00:00000:00000:1999/04/08 15:30:42.47 kernel ueoffline: engine 3 has outstanding ct-lib connections and cannot be offlined.

If there are tasks that cannot be migrated to another engine within several minutes, the task is killed, and a message similar to this is sent to the error log:

00:00000:00000:1999/04/08 15:20:31.26 kernel Process 57 is killed due to engine offline.

Monitoring engine status

Values in the status column of sysengines track the progress of dbcc engine commands:

The following command shows the engine number, status, number of tasks affinitied, and the time an engine was brought online:

select engine, status, affinitied, starttime 
from sysengines
engine status       affinitied  starttime         
------ ------------ ----------- --------------------------
     0 online                12        Mar  5 1999  9:40PM
     1 online                 9        Mar  5 1999  9:41PM
     2 online                12        Mar  5 1999  9:41PM
     3 online                14        Mar  5 1999  9:51PM
     4 online                 8        Mar  5 1999  9:51PM
     5 in offline            10        Mar  5 1999  9:51PM


Logical process management and dbcc engine(offline)

If you are using logical process management to bind particular logins or applications to engine groups, use dbcc engine(offline) carefully. If you offline all engines for an engine group:

Since engine affinity is assigned when a client logs in, users who are already logged in are not migrated if the engines in the engine group are brought online again with dbcc engine("online").


Monitoring CPU usage

To maintain the correct number of engines, monitor CPU usage with an operating system utility. See the configuration documentation for your platform for the appropriate utility for your operating system.