简体   繁体   English

Vaadin + Spring引导应用程序在长时间闲置后非常慢

[英]Vaadin + Spring boot application very slow after long idle time

I have a performance problem with my Vaadin 8 + Spring Boot application. Vaadin 8 + Spring Boot应用程序出现性能问题。

When I start the application after a long time without using, for example after one night, it tooks several minutes to get the response from the database. 当我长时间不使用而启动应用程序时(例如在一夜之后),需要几分钟才能从数据库获得响应。

I have following application settings: 我有以下应用程序设置:

    spring.datasource.max-active=10
    spring.datasource.initial-size=5
    spring.datasource.max-idle=5
    spring.datasource.min-idle=1
    spring.datasource.test-while-idle=true
    spring.datasource.test-on-borrow=true
    spring.datasource.validation-query=SELECT 1
    spring.datasource.time-between-eviction-runs-millis=5000
    spring.datasource.min-evictable-idle-time-millis=60000

Without test-while-idle , validation-query and test-on-borrow I couldnt even reconnect to the database again but the performance problem is still present. 如果没有“ test-while-idle ,“ validation-query和“ test-on-borrow我什至无法再次重新连接到数据库,但是性能问题仍然存在。

That looks like a JDBC connection which has been idle so long it has been timed out on the TCP/IP level. 看起来JDBC连接已经闲置了很长时间,在TCP / IP级别上已超时。 I wonder if there is either a setting that would auto-close JDBC connection after it has not been used for, say, 2 minutes. 我想知道是否有一种设置可以在未使用2分钟后自动关闭JDBC连接。 Or a heart-beat setting that would issue SELECT 1 every 5 minutes on all JDBC connections, to keep it alive. 或者是一个心跳设置,它将在所有JDBC连接上每5分钟发出SELECT 1 ,以使其保持活动状态。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM