---
title: "Spring boot 启动时间非常长的问题"
author: "GodJohnny"
date: "2016-09-20T16:44:22Z"
tags: []
categories: ["企业架构"]
slug: "spring-boot"
draft: false
lastmod: "2016-09-20T16:44:22Z"
id: 2325701
url: "https://godjohnny.iteye.com/blog/2325701"
---

一次项目实施过程中，发现线上的Spring boot在启动时，耗时非常长。在日志中发现这样的情况：

```java
o.a.c.util.SessionIdGeneratorBase        : Creation of SecureRandom instance for session ID generation using [sha1prng] took [170,241] milliseconds.
```

    查找相关资料，发现是随机数生成器的问题。需要在启动命令里加上
  
```java
 -Djava.security.egd=file:/dev/./urandom
```