Spring Hikari DB 线程池卡在套接字读取中
我的Java(17)Spring Boot(2.6.3)应用程序中有一个问题,该应用程序由AWS Aurora无服务器V1(Postgres)支持。使用hikari,所有设置均为默认设置。
该应用程序正在运行的查询非常简单,就像以下
select od.order_item_id,
od.order_id,
od.price,
od.quantity,
co.created
from order_details od
inner join created_order co
on od.order_id=co.order_id
where od.order_item_id='123456';
在Datagrip中运行此查询的查询通常使我有50-150ms的执行时间。
但是,我的应用程序在处理一批查询时似乎停止了磨损(〜2000左右)。查看JFR录制,我可以看到,由于某种原因,单个池线程被卡在插座中。我还在其他仪表板中看到,只有10个可用的hikari连接中只有1个。
以下是一个5分钟的快照,看来所有应用程序线程都在大部分时间都从我了解的时间等待。我已经检查了我的JVM指标,并且可以看到CPU约40%,JVM堆约55%,我找不到可以真正解释我在这里看到的东西的东西。
I'm having issues with one of my Java (17) Spring Boot (2.6.3) applications which is backed by an AWS Aurora Serverless v1 (Postgres). Hikari is used, and all settings are default.
The queries being run by the application are fairly simple like this
select od.order_item_id,
od.order_id,
od.price,
od.quantity,
co.created
from order_details od
inner join created_order co
on od.order_id=co.order_id
where od.order_item_id='123456';
Running this query in DataGrip typically gives me an execution time from 50-150ms.
However my application seems to come to a grinding halt when processing a batch of queries (around ~2000). Looking at a JFR recording, I can see that for some reason a single pool thread is stuck in socket read. I also see in my other dashboards that only 1 out of 10 available Hikari connections is being used.
Below is a 5 minute snapshot, and it looks like all application threads are waiting most of the time from what I understand. I have checked my JVM metrics and can see CPU around 40%, JVM Heap around 55% and I can´t find anything that can really explain what I'm seeing here.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论