我想为一个低性能的硬件优化一个Spring引导。我只是将JDBC用于SqlLite数据库。看起来一开始就浪费了5分钟,我不确定在哪里或者为什么。如果有人有什么建议的话。我看到了其他的想法,但我不确定它是否适用于我的情况,我的表现是覆盆子Pi 1。
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.3.2.RELEASE)
2021-08-02 14:18:55.075 INFO 24149 --- [ main] com.app.AppGatewayApplication : Starting AppGatewayApplication v0.0.1-SNAPSHOT with PID 24149 (/opt/app/app.jar started by root in /opt/app)
**2021-08-02 14:18:55.261 INFO 24149 --- [ main] com.app.AppGatewayApplication : No active profile set, falling back to default profiles: default
2021-08-02 14:22:46.915 WARN 24149 --- [ main] io.undertow.websockets.jsr : UT026010: Buffer pool was not set on WebSocketDeploymentInfo, the default pool will be used**
2021-08-02 14:22:51.668 INFO 24149 --- [ main] io.undertow.servlet : Initializing Spring embedded WebApplicationContext
2021-08-02 14:22:51.671 INFO 24149 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 230771 ms
2021-08-02 14:23:37.337 INFO 24149 --- [ main] o.f.c.internal.license.VersionPrinter : Flyway Community Edition 6.5.5 by Redgate
2021-08-02 14:23:45.163 INFO 24149 --- [ main] o.f.c.internal.database.DatabaseFactory : Database: jdbc:sqlite:data/app.db (SQLite 3.32)
2021-08-02 14:23:49.716 INFO 24149 --- [ main] o.f.core.internal.command.DbValidate : Successfully validated 19 migrations (execution time 00:02.585s)
2021-08-02 14:23:49.962 INFO 24149 --- [ main] o.f.core.internal.command.DbMigrate : Current version of schema "main": 1.1.19
2021-08-02 14:23:50.027 INFO 24149 --- [ main] o.f.core.internal.command.DbMigrate : Schema "main" is up to date. No migration necessary.
2021-08-02 14:23:51.952 INFO 24149 --- [ main] com.app.repository.e : Connection - - - - - - - - New DBConnection created发布于 2021-08-02 19:00:31
除非您知道造成时间损失的原因,否则很难提高性能。
因此,我将首先增加日志级别,以了解在此期间到底发生了什么。一旦明确了这一点,您就可以考虑如何提高性能了。
此外,从2.4版开始,Spring Boot提供了一些方法来了解在服务启动期间发生了什么,以及每一步需要多长时间。例如,您可以在这里找到一些关于如何将此监视构建到您的服务中的提示:https://www.amitph.com/spring-boot-startup-monitoring/
https://stackoverflow.com/questions/68623531
复制相似问题