Home >Java >javaTutorial >How to solve the problem that the interface developed using springboot is very slow when accessed for the first time

How to solve the problem that the interface developed using springboot is very slow when accessed for the first time

王林
王林forward
2023-05-17 19:22:042621browse

1, jdk changes startup parameters

Open the file $JAVA_PATH/jre/lib/security/java.security (in the directory where you installed jdk) and find the following content :

  securerandom.source=file:/dev/random

    Replace it with:

  securerandom.source=file:/dev/./urandom

2, Set dispatcherServlet for instant loading

spring:
mvc:
servlet:
load-on-startup: 1

3, Set the number of initialization links in the database connection pool

spring:

datasource:

hikari:

minimum-idle: 10

The above is the detailed content of How to solve the problem that the interface developed using springboot is very slow when accessed for the first time. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:yisu.com. If there is any infringement, please contact admin@php.cn delete