Java periodically hangs at futex and very low IO output

后端 未结 2 1436
星月不相逢
星月不相逢 2021-02-19 01:51

Currently my application periodically blocked in IO , and the output is very low . I use some command to trace the process.

By using jstack i found that the

2条回答
  •  我寻月下人不归
    2021-02-19 02:38

    In addition to clock jumps and aforementioned (rather old) THP kernel bug, another common reason for java to unexpectedly block on IO is reading very slow and blocking /dev/random which some libraries prefer over more commonly used and much better performing /dev/urandom.

    Easy way to tell if that was the culprit:

    sudo mv /dev/random /dev/random.real
    sudo ln -s /dev/urandom /dev/random
    

    ...then restart the app and see if it stops IO blocking. Once done with the test, you probably want to restore /dev/random:

    sudo mv /dev/random.real /dev/random
    

    ...and open a bug with application vendor asking to use /dev/urandom where appropriate.

提交回复
热议问题