---
title: "Key Set Processing for DataSync Agent"
canonical: "https://docs.perspectium.com/space/helium/2111719/Key%20Set%20Processing%20for%20DataSync%20Agent"
format: markdown
---
Key Set Processing  is a capability of the  DataSync Agent  which can be enabled when replicating messages from a ServiceNow instance to a database. The Key Set capability optimizes throughput while further ensuring message ordering.   NOTE : It's strongly recommended to enable this capability when replicating from a ServiceNow instance. This is enabled on a task by task basis by adding the following configuration direction within the  <task>  definition. <task>
	<enable_keyset_processing/>
	...
	...
</task> The following directives can be added to the  agent.xml  when enabling the  Key Set Processing :  Directive Description Example <keyset_size> Indicates the number of key set processor that will maintain the connection to the database.   NOTE : Overriding the default key set size (8) may reduce overall throughput of message processing. <keyset_size>4</keyset_size> <queue_consumer_polling_interval> Indicates the time interval the queue will be consumed. By default, the key set is scheduled to read from the queue every two seconds.  <queue_consumer_polling_interval>nn</queue_consumer_polling_interval>   NOTE :  The  value nn is in milliseconds. <keyset_read_wait_time> Indicates the time each key set processor will wait when reading from its queue. By default, the wait time is 200 milliseconds.  <keyset_read_wait_time>nn</keyset_read_wait_time> Example of the agent.xml  <?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<config>
    <agent>
        <share/>
        <subscribe>
			<task>
				<enable_keyset_processing/>
				<keyset_size>4</keyset_size>
				<queue_consumer_polling_interval>nn</queue_consumer_polling_interval>
				<keyset_read_wait_time>nn</keyset_read_wait_time>
				...
				...
			</task>
		</subscribe>
        <max_reads_per_connect>4000</max_reads_per_connect>
        <polling_interval>5</polling_interval>
        <skip_message_set_processing/>
    </agent>
</config> Similar topics Contact Perspectium Support US:  1 888 620 8880 UK:  44 208 068 5953 support@perspectium.com