Spring-boot在Liunx环境下启动卡顿问题解决

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/BuFanQi_Info/article/details/82017898

问题

spring-boot项目在本地启动时,速度非常快,但是在Liunx服务器上发布时,日志除了10几行出现卡顿很长一段时间(5-10分钟)才会完成。

原因

这是因为springboot内置tomcat启动时实例化SecureRandom对象随机数策略问题

解决办法

  • 找到java.security文件
    这里写图片描述
#securerandom.source=file:/dev/random 替换为:
securerandom.source=file:/dev/urandom

再次启动项目,速度正常。

猜你喜欢

转载自blog.csdn.net/BuFanQi_Info/article/details/82017898
今日推荐