Configuring Influx2PersistenceProviderPackage
To configure the Influx2PersistenceProviderPackage, perform the following steps:
1. In ThingWorx Composer, create a new persistence provider.
2. In the Persistence Provider Package field, select Influx2PersistenceProviderPackage.
3. Click Save.
4. Click the Configuration tab and configure the connection information as necessary and save. Reference the configuration options in the tables below. If you are using a persistence provider instance (created using InfluxDB persistence provider package) as the default persistence provider, you can edit the following stream and value stream queue configurations settings. These edits then apply to all streams and value streams. You cannot change these settings for a specific stream or value stream.
* 
When switching the persistence provider of a value stream (for example, from ThingworxPersistenceProvider to InfluxPersistenceProviderPackage), any Thing that implements a value stream must call the RestartThing service to retrieve entries written to the new persistence provider. If the Things are not restarted, entries may be written to the database, but they are not retrieved until the Thing is restarted.
Connection Information for Influx 2.x
Name
Description
Default Value
Connection URL
The URL of the database from which you should acquire connections.
http://localhost:8086
Token
The security token for accessing system, used instead of a password. (like an appkey).
Organization Name
Name of the organization
Bucket Name
Name of the data bucket (schema where all data is stored).
Auto Create Bucket
When set to true, creates the bucket specified in bucketName if it does not already exist. Otherwise an error will occur if bucket does not exist.
False
Retention Period (days)
The number of days data is retained. Data will be deleted after this period. The default 0, which is to retain the data forever.
0
Batch Size
This is the batch size used by the influx client. It will always send data points in batches for increased performance. This is in addition to the stream batch size. When batch size number of points are ready to send it sends the data to influx.
* 
The value is not in used and will be removed in a future release.
1000
Flush Interval
Indicates how often the influx client will flush data if it has not reached its batch size. Value is specified in milliseconds.
* 
The value is not in used and will be removed in a future release.
1000 or once per second
Fetch Size of data from the persistence provider
The count of rows to be fetched in batches instead of caching all rows on client side.
5000
Time for Connection Timeout
The amount of time to attempt a connection to influx. Value is specified in seconds.
10
Time for Read Timeout
The amount of time to read data from influx for a request. Value is specified in seconds.
10
Time for Write Timeout
The amount of time to try to write data to influx. Value is specified in seconds.
* 
For InFluxDB Cloud, PTC recommends setting Time for Write Timeout to 20 seconds.
20
Log Level
The log level of the influx client and the logs are sent to console output. The values can be NONE, BASIC, HEADERS or BODY with each level providing more information.
NONE
Stream Processing Settings for Influx 2.x
Name
Description
Base Type
Default Value
Max Wait Time Before Flushing Stream Buffer (millisec)
Number of milliseconds the system waits before flushing the stream buffer.
Number
10000
Max no. of Items Before Flushing Stream Buffer
Maximum number of items to accumulate before flushing the stream buffer.
Number
1000
Buffer Status Scan Rate (millisec).
The buffer status is checked at the specified rate value in milliseconds.
Number
5
Max Queue Size
Maximum number of stream entries to queue. Once the specified value is reached, the subsequent entries are rejected.
Number
250000
Max no. of Stream Writes in Process Block
Maximum number of stream writes to process in one block.
Number
2500
Number of Processing Threads
Number of processing threads dedicated to the stream.
* 
InfluxPersistenceProviderPackage provider performs better with a smaller number of threads. It is highly optimized to handle data from a smaller number of channels.
For Influx2PersistenceProviderPackage, it is not the case anymore. PTC recommends increasing the number of threads in order to get a better throughput. For InfluxDB Cloud, PTC recommends increasing the Number of Processing Threads to 10, Max Queue Sizeto 1000000, and Max no. of Value Stream Writes in Process Block to 25000, to reach a throughput of 80,000 wps.
Number
5
Max no. of Value Stream Write retry attempts
* 
This is available in ThingWorx 9.4.5 and later.
The number of times to retry batch writes if there is a write failure.
* 
The retry is not immediate but occurs at the next write attempt as specified by the Buffer Status Scan Rate config setting. Retries can solve the problem of short intermittent network glitches, but not when long connectivity pauses occur. If the data is not coming at a high rate and a longer period between retries is required, it is possible to modify the Buffer Status Scan Rate setting to allow writing attempts at a slower rate.
Integer
5
Value Stream Processing Settings for Influx 2.x
Name
Description
Base Type
Default Value
Max Wait Time Before Flushing Value Stream Buffer (millisec)
Number of milliseconds the system waits before flushing the value stream buffer.
Number
10000
Max no. of Items Before Flushing Value Buffer
Maximum number of items to accumulate before flushing the value stream buffer.
Number
1000
Buffer Status Scan Rate (millisec)
The buffer status is checked at the specified rate value in milliseconds.
Number
5
Max Queue Size
Maximum number of value stream entries to queue. Once the specified value is reached, the following entries are rejected.
Number
1000000
Max no. of Value Stream Writes in Process Block
Maximum number of items to process in one block.
Number
25000
Number of Processing Threads
Number of processing threads allocated to the value stream.
* 
InfluxPersistenceProviderPackage provider performs better with a smaller number of threads. It is highly optimized to handle data from a smaller number of channels.
For Influx2PersistenceProviderPackage, it is not the case anymore. PTC recommends increasing the number of threads in order to get a better throughput. For InfluxDB Cloud, PTC recommends increasing the Number of Processing Threads to 10, Max Queue Sizeto 1000000, and Max no. of Value Stream Writes in Process Block to 25000, to reach a throughput of 80,000 wps.
Number
10
Max no. of Value Stream Write retry attempts
* 
This is available in ThingWorx 9.4.5 and later.
The number of times to retry batch writes if there is a write failure.
* 
The retry is not immediate but occurs at the next write attempt as specified by the Buffer Status Scan Rate config setting. Retries can solve the problem of short intermittent network glitches, but not when long connectivity pauses occur. If the data is not coming at a high rate and a longer period between retries is required, it is possible to modify the Buffer Status Scan Rate setting to allow writing attempts at a slower rate.
Integer
5
5. Click the General Information tab and select the Active check box.
6. Click Save.
Was this helpful?