In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article introduces how to solve the controller service made by springboot. The first request takes a long time after a period of time, and the content is very detailed. Interested friends can use it for reference. I hope it will be helpful to you.
1. After accessing any interface, the access speed of this interface is normal in a short period of time. However, the access speed of the first request is very slow after a period of time (about a few seconds), and the client shows that the time-consuming is 3000ms, but the normal time spent on server printing is 60ms.
2. This problem does not occur when debugging the native windows environment, but when deployed to the linux system.
Question:
No matter using browser, Postman, curl, Python (requests) to access the interface, it is very time-consuming to get the first response, and the second visit will be much faster in a short time.
The server printing time in controller has been about normal time consuming 60ms. When the first response is very slow, the server printing time is still 60ms, but the client printing time is 3000ms. You can rule out network (client request code on the same machine as the server), performance (test environment), and so on.
Solution:
First: upgrade springboot,spring-boot-starter-parent from 1.4.2 version to 1.5.9 version, after the upgrade, the problem is solved. (we currently use this solution) if the jsp page cannot be accessed after the upgrade, please refer to http://blog.csdn.net/wwd0501/article/details/79609415.
The second is to package it into a war package and deploy it to a normal tomcat, and the problem is solved. (http://blog.csdn.net/wwd0501/article/details/79555215 with war package)
Third: change the built-in Tomcat to undertow, and the problem is solved.
Modify the pom file
Org.springframework.boot spring-boot-starter-web org.springframework.boot spring-boot-starter-tomcat org.springframework.boot spring-boot-starter-logging When org.springframework.boot spring-boot-starter-undertow talks about how to solve the controller service made by springboot, every once in a while, the first request takes a long time to share here. I hope the above content can be of some help to you and learn more knowledge. If you think the article is good, you can share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.