文章目录

  • 如何提高 Spring Boot 应用的启动速度

如何提高 Spring Boot 应用的启动速度


1、减少@ComponentScan @SpringBootApplication 扫描类时候的范围
2、关闭 Spring Boot 的 JMX 监控,设置 spring.jmx.enabled=false
3、设置 JVM 参数 -noverify ,不对类进行验证
4、对非必要启动时加载的 Bean ,延迟加载
5、使用 Spring Boot 的全局懒加载
6、AOP 切面尽量不使用注解方式,这会导致启动时扫描全部方法
7、关闭 endpoint 的一些监控功能
8、排除项目多余的依赖 jar
9、swagger 扫描接口时,指定只扫描某个路径下的类
10、Feign 客户端接口的扫描缩小包扫描范围

更多推荐

如何提高 Spring Boot 应用的启动速度