springboot接口慢_springboot 启动后,第一次的接口请求总是很慢,后面速度就很快,怎么解决?...

shayang888

2019-11-19 17:04:49 +08:00

@chendy

2019-11-19 17:02:31.814 DEBUG 53080 --- [ctor-http-nio-3] o.s.w.s.adapter.HttpWebHandlerAdapter : [17aa98db] HTTP GET "/test"

2019-11-19 17:02:31.839 DEBUG 53080 --- [ctor-http-nio-3] s.w.r.r.m.a.RequestMappingHandlerMapping : [17aa98db] Mapped to com.example.demo.DemoApplication#test()

2019-11-19 17:02:31.856 DEBUG 53080 --- [ctor-http-nio-3] o.s.w.r.r.m.a.ResponseBodyResultHandler : Using 'text/plain;charset=UTF-8' given [*/*] and supported [text/plain;charset=UTF-8, text/event-stream, text/plain;charset=UTF-8, */*]

2019-11-19 17:02:31.857 DEBUG 53080 --- [ctor-http-nio-3] o.s.w.r.r.m.a.ResponseBodyResultHandler : [17aa98db] 0..1 [java.lang.String]

2019-11-19 17:02:31.860 DEBUG 53080 --- [ctor-http-nio-3] o.s.core.codec.CharSequenceEncoder : [17aa98db] Writing "test"

2019-11-19 17:02:31.877 DEBUG 53080 --- [ctor-http-nio-3] o.s.w.s.adapter.HttpWebHandlerAdapter : [17aa98db] Completed 200 OK

--------------------------------------------------------------

2019-11-19 17:02:33.311 DEBUG 53080 --- [ctor-http-nio-3] o.s.w.s.adapter.HttpWebHandlerAdapter : [17aa98db] HTTP GET "/test"

2019-11-19 17:02:33.312 DEBUG 53080 --- [ctor-http-nio-3] s.w.r.r.m.a.RequestMappingHandlerMapping : [17aa98db] Mapped to com.example.demo.DemoApplication#test()

2019-11-19 17:02:33.312 DEBUG 53080 --- [ctor-http-nio-3] o.s.w.r.r.m.a.ResponseBodyResultHandler : Using 'text/plain;charset=UTF-8' given [*/*] and supported [text/plain;charset=UTF-8, text/event-stream, text/plain;charset=UTF-8, */*]

2019-11-19 17:02:33.312 DEBUG 53080 --- [ctor-http-nio-3] o.s.w.r.r.m.a.ResponseBodyResultHandler : [17aa98db] 0..1 [java.lang.String]

2019-11-19 17:02:33.312 DEBUG 53080 --- [ctor-http-nio-3] o.s.core.codec.CharSequenceEncoder : [17aa98db] Writing "test"

2019-11-19 17:02:33.315 DEBUG 53080 --- [ctor-http-nio-3] o.s.w.s.adapter.HttpWebHandlerAdapter : [17aa98db] Completed 200 OK

2 次的时间明显不一样,第一次花了 60 多 ms,第二次直接 3ms 就完成了

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值