futex() 调用过多

发布于 2024-09-12 16:25:01 字数 290 浏览 9 评论 0原文

我们在 Linux RedHat 机器上的一个 Java 应用程序尝试发布到外部 MQ 队列时观察到异常延迟(以前从未发生过)。对盒子进行了快速运行状况检查,CPU/内存使用情况似乎相当不错。 MQ盒子也很不错。重新启动了我的 Java 进程,没有运气!之后我们快速获取了 strace 快照,其中充满了 futex() 调用。

想知道是否有人可以提供任何线索来解释为什么会发生这么多锁(我知道这是一个非常开放的问题。取决于应用程序的实际用途)。

但我希望能够更深入地了解这个问题。

We are observing unusual delays in one of our Java apps on a Linux RedHat machine while trying to publish to an external MQ queue (It never happened before). Did a quick health check on the box and the CPU/memory usage seems quite alright. The MQ boxes are quite fine as well. Restarted my Java process, no luck! We grabbed a quick strace snapshot after that and it is full of futex() calls.

Was wondering if somebody could give any clues on why so many locks could be happening (I know it is a very wide open kind of question. Depends on what the app actually does).

But I was hoping to get some more insight into the problem.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

心房敞 2024-09-19 16:25:01

那么您是否真正对其进行了分析并确定 futex 调用是瓶颈?

假设您这样做了,一件事可能是 futex() 系统调用意味着互斥体已被争用; FUTEX = 快速用户空间互斥体,无竞争互斥体在用户空间中处理,无需系统调用。也就是说,您可能会遇到锁争用问题。

So did you actually profile it and determined that futex calls are the bottleneck?

Assuming you did, one thing might be that a futex() syscall implies that the mutex is contended; FUTEX = fast user space mutex, uncontended mutexes are handled in user-space without a syscall. That is, you might have a problem with lock contention.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文