Copyright © Cloud Software Group, Inc. All Rights Reserved
Copyright © Cloud Software Group, Inc. All Rights Reserved


Chapter 11 Administering the Work Queue Server and Work Item Server Processes : The WQS Process

The WQS Process
The Work Queue Server (WQS) process handles the listing of work queues. The WQS process allocates one or more queues to each WIS process and responds to client RPC requests to access these queues.
The WQS process is multi-threaded, allowing it to perform multiple tasks simultaneously. Different threads are used to:
The following diagram shows:
the different aspects of the WQS process’ behavior that you can configure.
 


 
Configuring WQS RPC Request Processing
To process RPC requests, both the WQS and WIS processes access a pool of “worker” threads that is provided by a multi-threaded RPC server shared library (SWRPCMTS). You can use the RPC_SVR_CONTROL process attribute to define the number of threads that are available in the SWRPCMTS library to process RPC requests.
You can adjust the value of this process attribute to optimize the WQS and WIS process’ response times when processing RPC requests against available CPU capacity. Increasing the number of threads will improve the throughput of client RPC requests, but at the cost of increased CPU usage.
The RPC processing threads perform their work independently of and concurrently with the queue update thread. In pre-10.4 versions of iProcess Engine, where the WQS process was single-threaded, the WQS process had to switch between processing RPC requests and updating work queues.
Configuring the Assignment of Queues to WIS Processes
When iProcess Engine starts up, the WQS process is responsible for assigning all the work queues to WIS processes.
By default, queues are assigned to WIS processes dynamically, using either the round-robin or on-demand method (as determined by the WQS_ROUND_ROBIN parameter in the staffcfg file, which is located in the SWDIR\etc directory- see WQS_ROUND_ROBIN on page 49):
Round-robin. This method assigns a work queue to each WIS process alphabetically, cycling round until all work queues are assigned. For example, if a system has 5 WIS processes and 20 work queues A to O then:
The round-robin method takes no account of queue size. It is best used when the messages are fairly evenly distributed between the majority of queues and user access is also evenly spread.
On-demand. This method assigns work queues to WIS processes based on cost. All work queues have a weighting (determined by the WQS_QUEUE_WEIGHTING parameter) that determines the cost of the work queue to the WIS process. Queues are assigned to the WIS process with the lowest overall cost. The more work queues that are allocated to a WIS process, the higher the cost of the WIS process so the less new work queues are allocated to it. The cost calculation is as follows:
cost = wicount + (WQS_QUEUE_WEIGHTING * qcount)
where:
wicount is the number of work items the WIS process is currently processing.
qcount is the number of work queues the WIS process is currently processing.
The number of items in a work queue is taken from data that has been persisted to the wqs_index database table. If, for example, a new queue has been added to iProcess Engine after it has been started, it means the allocation of the work queues may not reflect the actual count of work items in the work queue. To overcome this, restart iProcess Engine. This results in the work queues being re-allocated according to the latest work item count.
To control how work queues are allocated to WIS processes, you can adjust the WQS_QUEUE_WEIGHTING parameter. This parameter changes the cost of a work queue to a WIS process. For example, the larger the value, the more that the number of work queues rather than the number of work items in the work queues determines whether a work queue is allocated to a WIS process. Therefore, if you have lots of work queues with an even amount of work items in each, you may want to increase the value of the WQS_QUEUE_WEIGHTING parameter. If you only have a few work queues that contain large amounts of work items, you may want to lower the value.
The effect of on-demand assignment is that work queues are distributed across WIS processes based on their cost so a more even distribution of work queues is achieved.
However, there are two additional methods you can use to customize the assignment process to better reflect your system requirements, and so optimize performance.
The following sections describe these methods.
Using Different WIS Processes to Handle User and Group Queues
User queues and group queues frequently have different characteristics, in terms of the amount of load they carry.
For example, if group queues are far more active than user queues on your system, you may want to give them higher priority for WIS process allocation.
You can do this by specifying the WQS_WIS_USER_COUNT process attribute for the WQS process. This attribute defines the number of WIS processes that should be dedicated to handling user queues and group queues respectively (either as a fixed number or as a percentage of the available processes). See WQS_WIS_USER_COUNT on page 238 for more information.
Assigning a Queue Explicitly to a WIS Process
If you have certain queues that are very large or very busy, you may find it useful to dedicate specific WIS processes to handling only those queues (leaving the remaining queues to be dynamically assigned to the remaining WIS processes).
To dedicate a specific WIS process to handling a specific queue:
1.
2.
To make it possible to allocate queues to specific WIS processes, define a new attribute called SW_WISINST. This should have a Type of Numeric, with a Decimal value of 0.
See “Adding a New Attribute” in TIBCO iProcess Workspace (Windows) Manager's Guide for more information.
3.
To assign a queue to a specific WIS process, assign the WIS instance number that you want the queue to use as the value of the SW_WISINST attribute for that queue. (You can use the swadm show_processes command to list the available WIS instances - see Show Server Processes.)
See “Setting User Values for an Attribute” in TIBCO iProcess Workspace (Windows) Manager's Guide for more information.
4.
Save your changes, exit from User Manager and perform a MoveSysInfo event to register your changes on iProcess Engine.
See “Moving System Information” in TIBCO iProcess Workspace (Windows) Manager's Guide for more information.
5.
If the queue is already in use (and therefore already allocated to a WIS process), you will need to stop and restart iProcess Engine before the change takes effect.
Once a WIS process has been dedicated to handling a specific queue or queues, it will handle only those queues. It is no longer available for dynamic queue allocation.
There is one exception to this: if all the available WIS processes are dedicated to handling specific queues, and a new queue is added, the queues are no longer treated as dedicated. This means that:
the new queue will be dynamically assigned to the appropriate WIS process, according to the current dynamic allocation rules. All dedicated WIS processes are considered to be available to handle the queue. See Using Different WIS Processes to Handle User and Group Queues.
the dedicated WIS processes continue to handle their assigned queues (but they may also have to handle the newly assigned queue as well).
An Example of How to Use These Assignment Methods
By using the methods described above, you can configure your system to operate more efficiently under load. For example, consider a system that has 6 WIS processes (WIS 1-6), 8 group queues (GQ1-8) and 500 users (UQ1-500). Queue characteristics are:
The system is now configured as follows:
WQS_WIS_USER_COUNT is set to 2
This means that:
The remaining 6 group queues, GQ3 to GQ8, are handled by 2 of the 4 remaining WIS processes. The queues are dynamically assigned to WIS processes.
Configuring When the WQS/WIS Shared Memory is Written to the Database
The WQS/WIS shared memory cache holds summary information about work queues, such as which WIS process is handling a queue, how many work items it contains, how many new items, items with deadlines and so on. This information is constantly updated by the WQS and WIS processes.
The shared memory persistence thread wakes up every WQS_PERSIST_SHMEM seconds and writes the contents of the WQS/WIS shared memory to the wqs_index database table.
When the WIS process starts up, it needs to know how many work items are in each queue that it is handling, so that it can determine whether or not to cache the queue immediately (see Configuring When WIS Processes Cache Their Queues). The WIS process can therefore read this information from the total_items column in the wqs_index database table.

Copyright © Cloud Software Group, Inc. All Rights Reserved
Copyright © Cloud Software Group, Inc. All Rights Reserved