In a multiengine environment, any available engine can process the next task in the global run queue. The engine affinity attribute lets you assign a task to an engine or to a group of engines (in threaded mode, this is done with thread pools).
To organize task-to-engine affinity:
Associate less critical execution objects with a defined group of engines to restrict the object to a subset of the total number of engines. This reduces processor availability for those objects. The more critical execution objects can execute on any Adaptive Server engine, so performance for them improves because they have the benefit of the resources that the less critical ones are deprived of.
Associate more critical execution objects with a defined group of engines to which less critical objects do not have access. This ensures that the critical execution objects have access to a known amount of processing power.
In process mode, when optimal performance for a network-intensive task is the primary concern, administrators can use task-to-engine affinity coupled with dynamic listeners to ensure that tasks run on the same engine as all the tasks’ network I/O. In threaded mode, this is not required due to the lack of dedicated network engines.
EC1 and EC2 do not set engine affinity for the execution object; however, EC3 sets affinity to the Adaptive Server engine with the highest engine number in the current configuration.
Use sp_addengine to create engine groups and sp_addexeclass to bind execution objects to an engine group. If you do not want to assign engine affinity for a user-defined execution class, use ANYENGINE as the engine group parameter.
In threaded mode, use create thread pool to create a new thread pool. Use sp_addexeclass to bind execution objects to thread pools.
The engine affinity attribute is not used for stored
procedures.