akka.io.pinned 上的高 CPU-Windows 上的调度程序

High CPU on akka.io.pinned-dispatcher on Windows

问题 akka.io.pinned-调度程序在一个核心上利用 100% CPU 在通道选择器上进行无限循环选择。 使用Spray框架时也会遇到同样的问题。

最初的解决方法来自 Google Group

禁用 Windows 连接关闭检测是解决此问题的方法。

akka {

  io {

    tcp {

      # On Windows connection aborts are not reliably detected unless an OP_READ is
      # registered on the selector _after_ the connection has been reset. This
      # workaround enables an OP_CONNECT which forces the abort to be visible on Windows.
      # Enabling this setting on other platforms than Windows will cause various failures
      # and undefined behavior.
      # Possible values of this key are on, off and auto where auto will enable the
      # workaround if Windows is detected automatically.

      windows-connection-abort-workaround-enabled = off
    }

  }

}