Implementing Multi-Threading

In order to improve performance, the Service Manager adapter utilizes multiple threads for the push of CI and Relationship data to SM. The following section explains these settings and how to configure them for maximum performance.

The multi-threading configuration is defined in the sm.properties file on the UCMDB server. To view or edit the file in UCMDB, navigate to Data Flow Management > Adapter Management > ServiceManagerEnhancedAdapter9.41 > Configuration Files > sm.properties.

The following are example multi-threading definitions in the sm.properties file:

01 number.of.concurrent.sending.threads=6

02 min.objects.for.concurrent.sending=50

03 number.of.chunks.per.thread=3

04 recommended.min.cis.per.chunk=50

Explanation

The code excerpt illustrates the relevant multi threading settings on the UCMDB server.

  • Line 01 defines the number of parallel threads UCMDB will open to SM for CI push. Setting this parameter to 1 disables multi-threading, while a values of 2 or higher enables multi-threading.
  • Line 02 defines the minimum number of SM objects needed to use multiple threads as opposed to a single thread.
  • Line 03 defines the number of chunks per thread. This number multiplied by the number of threads gives you the total number of CI data chunks.
  • Line 04 defines the recommended minimum number of CIs per CI data chunk.

The total number of chunks = number.of.chunks.per.thread * number.of.concurrent.sending.threads

The integration implements a queue mechanism as follows:

The data passed from UCMDB to SM is divided into equal chunks, and these chunks are placed in a queue.

Each available thread pulls the next chunk from the queue until all threads are available. Once this process has completed, the push is complete.

The mechanism is designed to minimize idle time of each thread. As each thread processes its chunk in parallel, some threads may finish before others and it is inefficient for them to wait for each other.

Caution Defining too many threads

It is ineffective to over-increase the number of threads as this causes the SM server to overload. In enterprise environments where the SM server processing the push data is very robust the number of threads can be increased to 10 and in some cases even 20; however, you must take into account that increasing the number of threads raises CPU usage on the SM server during push, which may reduce application performance.