taosdata / TDengine

High-performance, scalable time-series database designed for Industrial IoT (IIoT) scenarios
https://tdengine.com
GNU Affero General Public License v3.0
23.2k stars 4.84k forks source link

java通过tsdb方式连接TDengine执行插入操作时,java进程的句柄数超高,直至线程崩溃 #26680

Open fancy-FJ opened 1 month ago

fancy-FJ commented 1 month ago

java通过tsdb方式连接TDengine执行插入操作时,java进程的句柄数超高,直至线程崩溃 数据库服务端版本号:3.3.2.0 Community 数据库客户端版本号:3.3.2.0 java的Maven依赖版本号(taos-jdbcdriver):3.3.0

fancy-FJ commented 1 month ago

我用的是TDengine-server-3.3.2.0-Linux-x64.tar.gz包里的TDengine-server-3.3.2.0\examples\JDBC\springbootdemo软件包 执行init方法时,java进程所持有句柄数以每秒1000多个句柄速度上涨 修改了以下文件 1、application.properties文件内容

datasource config - JDBC-JNI

spring.datasource.driver-class-name=com.taosdata.jdbc.TSDBDriver spring.datasource.url=jdbc:TAOS://192.168.110.32:6030/jala?timezone=UTC-8&charset=UTF-8&locale=en_US.UTF-8 spring.datasource.username=root spring.datasource.password=taosdata

datasource config - JDBC-RESTful

spring.datasource.driver-class-name=com.taosdata.jdbc.rs.RestfulDriver

spring.datasource.url=jdbc:TAOS-RS://192.168.110.32:6041/test

spring.datasource.username=root

spring.datasource.password=taosdata

spring.datasource.druid.initial-size=5 spring.datasource.druid.min-idle=5 spring.datasource.druid.max-active=20 spring.datasource.druid.max-wait=30000 spring.datasource.druid.validation-query=select server_status(); spring.aop.auto=true spring.aop.proxy-target-class=true spring.datasource.druid.stat-view-servlet.enabled=true spring.datasource.druid.stat-view-servlet.loginUsername=admin spring.datasource.druid.stat-view-servlet.loginPassword=123456

mybatis

mybatis.mapper-locations=classpath:mapper/*.xml logging.level.com.taosdata.jdbc.springbootdemo.dao=debug server.port=5050 2、WeatherService.java 修改了for循环次数,20改成了20000

yu285 commented 1 month ago

收到我们看下。

dlb1986 commented 1 month ago

同样的问题,看起来server侧开启了过多的socket而没有关闭。openfile增长速率与数据写入速率基本相当。 image image

firewolf2010 commented 1 month ago

我也遇到了类似的问题,服务器中使用docker安装了一个tdengine集群,设置了200万的最大文件数量,整个集群没有任何的写入操作,就只用了explorer进行了简单的查询操作。整个服务器的文件描述符就不断在被耗尽,直到全部耗尽,服务器无法操作。

yu285 commented 2 weeks ago

我们正在处理这个问题,修复后会通知大家