【Communications link failure】业务读写StarRocks异常

【详述】使用druid 驱动连接StarRocks异常
【业务影响】
【StarRocks版本】2.5.12
【集群规模】3fe + 5be
业务端报错:
Communications link failure The last packet successfully received from the server was 334 milliseconds ago. The last packet sent successfully to the server was 330 milliseconds ago.; nested exception is com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure The last packet successfully received from the server was 334 milliseconds ago. The last packet sent successfully to the server was 330 milliseconds ago.

The last packet successfully received from the server was 334 milliseconds ago. The last packet sent successfully to the server was 330 milliseconds ago.] with root cause
java.io.EOFException: Can not read response from server. Expected to read 4 bytes, read 0 bytes before connection was unexpectedly lost.

数据库连接池配置:
db:
datasource:
doris:
url: jdbc:mysql://xxx:3306/{database}?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&autoReconnectForPools=true
username: {username}
password: {password}
driver-class-name: com.mysql.jdbc.Driver
maximum-pool-size: 500
max-idle: 10
max-wait: 10000
min-idle: 5
initial-size: 5
validation-query: SELECT 1
test-on-borrow: true
test-while-idle: true
time-between-eviction-runs-millis: 30000

wait_timeout=28800
query_timeout=300
nginx配置:
server{
listen 8030;
proxy_connect_timeout 10s;
proxy_timeout 300s;
}
问题跟上述一致。

这应该是druid到nginx的空闲连接清理策略没对齐

1赞

druid到nginx的空闲连接清理策略是哪个参数控制的?nginx是4层。

你把nginx的keepalive调大到300s看看

druid不太熟悉,网上找找资料吧

4层没有keepalive参数。7层有。这里是4层。

你们是写数据超时?不是读数据超时?

读超时