Hi
I use the influxDB 1.7.0 + graphana 5.2.2 + java.
encountered a problem. Data is coming to me from one device every 10 seconds. And when you write data from the device to the database opens an incredible number of threads (about 6 thousand) which are in the standby mode. If to judge by dump - flows ohntp3 TsongnethionPool, which is not used in my project directly.
Example of a DB writing code
public void writeToInflux( ProtocolV1Class protocolClass, InfluxDB influxDB ){
try {
double latitude = 0, longitude = 0;
String table_name = getTableName( protocolClass );
System.out.println("Название таблицы " + table_name);
influxDB.setDatabase(dbName);
influxDB.enableBatch(300, 10, TimeUnit.SECONDS);
BatchPoints batchPoints = BatchPoints.database(dbName).build();
for( int i = 0; i < protocolClass.telemetry.size(); i++ ) {
Builder builder = Point.measurement(table_name)
.time( Time.secondsToMillis( protocolClass.time ), TimeUnit.MILLISECONDS )
.tag( "uid", protocolClass.getUid() )
.tag( "tagName", protocolClass.telemetry.get(i).getName() )
.addField( "protocol", protocolClass.getProtocol() );
// Write telemetry data
if( isString ( protocolClass.telemetry.get(i).value ) ) {
for( Map.Entry<String, String> entry : protocolClass.tags.entrySet() ) {
builder.tag( entry.getKey(), entry.getValue() );
}
for( Map.Entry<String, String> entry : protocolClass.telemetry.get(i).tags.entrySet() ) {
builder.tag( entry.getKey(), entry.getValue() );
}
builder.addField( "value_string", protocolClass.telemetry.get(i).getValue() );
Point point = builder.build();
batchPoints.point(point);
influxDB.write(batchPoints);
influxDB.flush();
point = null;
builder = null;
}
batchPoints = null;
influxDB.close();
} catch( Exception e ) {
log.severe("InfluxDbWriter writeToInflux " + e );
}
}
What could be the reason for discovering such a large number of threads? I am hope for your help.