今天我注意到我的 LDAP 服务器 (OpenDS) 在每个可用核心上消耗了 100% 的 CPU。快速诊断显示 futex 锁定期间存在大量 ETIMEDOUT。
我该如何调试它来弄清楚发生了什么以及如何修复它?
futex(0x7f7ecf9053a4, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 1540779077, {1342114766, 309244206}, ffffffff) = -1 ETIMEDOUT (Connection timed out)
futex(0x7f7ecf9053d0, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x7f7ecf9053a4, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 1540779079, {1342114766, 309528293}, ffffffff) = -1 ETIMEDOUT (Connection timed out)
futex(0x7f7ecf9053d0, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x7f7ecf9053a4, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 1540779081, {1342114766, 309812186}, ffffffff) = -1 ETIMEDOUT (Connection timed out)
futex(0x7f7ecf9053d0, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x7f7ecf9053a4, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 1540779083, {1342114766, 310107537}, ffffffff) = -1 ETIMEDOUT (Connection timed out)
futex(0x7f7ecf9053d0, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x7f7ecf9053a4, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 1540779085, {1342114766, 310406075}, ffffffff) = -1 ETIMEDOUT (Connection timed out)
futex(0x7f7ecf9053d0, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x7f7ecf9053a4, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 1540779087, {1342114766, 310705339}, ffffffff) = -1 ETIMEDOUT (Connection timed out)
futex(0x7f7ecf9053d0, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x7f7ecf9053a4, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 1540779089, {1342114766, 311018839}, ffffffff) = -1 ETIMEDOUT (Connection timed out)
futex(0x7f7ecf9053d0, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x7f7ecf9053a4, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 1540779091, {1342114766, 311315446}, ffffffff) = -1 ETIMEDOUT (Connection timed out)
futex(0x7f7ecf9053d0, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x7f7ecf9053a4, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 1540779093, {1342114766, 311632617}, ffffffff) = -1 ETIMEDOUT (Connection timed out)
futex(0x7f7ecf9053d0, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x7f7ecf9053a4, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 1540779095, {1342114766, 311951779}, ffffffff) = -1 ETIMEDOUT (Connection timed out)
futex(0x7f7ecf9053d0, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x7f7ecf9053a4, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 1540779097, {1342114766, 312278610}, ffffffff) = -1 ETIMEDOUT (Connection timed out)
futex(0x7f7ecf9053d0, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x7f7ecf9053a4, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 1540779099, {1342114766, 312601929}, ffffffff) = -1 ETIMEDOUT (Connection timed out)
futex(0x7f7ecf9053d0, FUTEX_WAKE_PRIVATE, 1) = 0
不确定是否相关 - 但我还注意到 Redmine(Ruby 应用程序)具有类似的“功能”...帮助:)
答案1
哇,我花了额外的时间在谷歌上搜索,似乎闰秒是一个原因:
http://blog.wpkg.org/2012/07/01/java-leap-second-bug-30-june-1-july-2012-fix/
解决方案:
date `date +"%m%d%H%M%C%y.%S"`