1.用的workbench跑的sql,用了模糊查询(后缀%)、排序、分页。加了组合索引,用时差不多1.5s
2.用junit测试service方法差不多也是这个用时
3.跑tomcat的时候这个service方法却用了20+s,controller没有比较任何耗时的逻辑,用debug打断点的时候的确是这句sql特别慢
不知道是不是tomcat的缘故还是其他的问题,不知道怎么排查这个问题了。
怪我咯2017-04-18 10:34:14
This has nothing to do with Tomcat.
Provide a tool XRebel that can monitor the time consuming of the code execution link after it is configured. You can intuitively see the execution time of each method, and it is very easy to locate the point that takes a long time.