Wednesday, June 2, 2010

ADS 10 Tip #3 – Worker Threads

Worker threads are used by Advantage to process all database requests, the number of worker threads indicates how many simultaneous database operations can be performed. The default setting prior to version 10 was eight. The default for version 10 is eight per CPU/Core, so if you have a dual core CPU Advantage you will have sixteen threads configured.

This calculation is done when Advantage starts and when the configuration parameter for worker threads is set to zero. You can still specify a specific number of worker threads, we recommend between eight and sixteen threads per CPU/Core.

When all of the configured worker threads are busy new requests are placed in a queue for processing. In previous versions of Advantage these threads were processed in the order they were received. In version 10 the queue has been modified to allow for prioritization of the requests. Advantage automatically calculates the average cost of each connection. When the request queue is full a threshold is calculated and connections with costs below the threshold are placed in the express queue. These requests will be processed with the next available worker thread.

You can get information about the express queue using the sp_MgGetConnectedUsers and sp_MgGetActivityInfo which both have new fields that report express queue activity. The AverageCost is displayed for each user when you call sp_MgGetConnectedUsers. The express queue threshold, express queue active threads and express queue operations are all displayed when calling sp_MgGetActivityInfo. Screenshots of the results of these procedures when running multiple clients are shown below. Only the pertinent fields are displayed.

sp_MgGetConnectedUsers

ExpressQueue1

sp_MgGetActivityInfo

ExpressQueue2

1 comment:

Anonymous said...

Hallo,
we have Advantage Database Server 11.10 for Windows. We have Problems with Performance when we have more than one cpu in the Windows VM

Mfg
Hornauer