NutzCN Logo
问答 本地Tomcat访问无问题 发布到阿里云 数据库查询异常缓慢
发布于 2020天前 作者 nidegexing 1933 次浏览 复制 上一个帖子 下一个帖子
标签:

本地:Win10,JDK1.8,Tomcat8,阿里云新安装的Mysql数据库。访问迅速。
生产:Centos,JDK1.8,Tomcat8,同本地。访问异常缓慢,经过查看日志,总是卡在执行SQL,

生产日志如下: banner表均为小字段,且数据量只有10条。advertisement 表同样的情况。
根据现象怀疑查库就特别慢,超时。
dao.js按照官网教程默认配置,mysql按照网上的教程默认安装。请问这些是否有问题,帮分析下可能是哪里有问题。

2019-05-12 16:28:01,823 DEBUG [http-bio-80-exec-4] UrlMappingImpl - Search mapping for path=/robots : NOT Action match
2019-05-12 16:31:12,572 DEBUG [http-bio-80-exec-5] UrlMappingImpl - Found mapping for [GET] path=/index : IndexController.index(IndexController.java:132)
2019-05-12 16:31:12,572 DEBUG [http-bio-80-exec-5] NutIoc - Get 'indexController'<class com.lewen.controllers.IndexController>
2019-05-12 16:31:12,573 DEBUG [http-bio-80-exec-5] NutDaoExecutor - select * from banner
java.net.ConnectException: Connection timed out
	at java.net.PlainSocketImpl.socketConnect(Native Method)
	at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
	at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
	at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
	at java.net.Socket.connect(Socket.java:589)
	at java.net.Socket.connect(Socket.java:538)
	at sun.net.NetworkClient.doConnect(NetworkClient.java:180)
	at sun.net.www.http.HttpClient.openServer(HttpClient.java:432)
	at sun.net.www.http.HttpClient.openServer(HttpClient.java:527)
	at sun.net.www.http.HttpClient.<init>(HttpClient.java:211)
	at sun.net.www.http.HttpClient.New(HttpClient.java:308)
	at sun.net.www.http.HttpClient.New(HttpClient.java:326)
	at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1169)
	at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1105)
	at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:999)
	at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:933)
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1513)
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1441)
	at com.lewen.controllers.IndexController.getCityNo(IndexController.java:446)
	at com.lewen.controllers.IndexController.index(IndexController.java:162)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.nutz.mvc.impl.processor.MethodInvokeProcessor.process(MethodInvokeProcessor.java:25)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.AdaptorProcessor.process(AdaptorProcessor.java:33)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.ActionFiltersProcessor.process(ActionFiltersProcessor.java:58)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.ModuleProcessor.process(ModuleProcessor.java:123)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.EncodingProcessor.process(EncodingProcessor.java:27)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.UpdateRequestAttributesProcessor.process(UpdateRequestAttributesProcessor.java:15)
	at org.nutz.mvc.impl.NutActionChain.doChain(NutActionChain.java:44)
	at org.nutz.mvc.impl.ActionInvoker.invoke(ActionInvoker.java:67)
	at org.nutz.mvc.ActionHandler.handle(ActionHandler.java:31)
	at org.nutz.mvc.NutFilter.doFilter(NutFilter.java:198)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:110)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:494)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:1025)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:445)
	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1137)
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:637)
	at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:317)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Thread.java:745)
2019-05-12 16:33:19,979 DEBUG [http-bio-80-exec-5] UrlMappingImpl - Found mapping for [POST] path=/index/adv/advList : IndexController.getAdvList(IndexController.java:534)
2019-05-12 16:33:19,979 DEBUG [http-bio-80-exec-5] NutIoc - Get 'indexController'<class com.lewen.controllers.IndexController>
2019-05-12 16:33:19,980 DEBUG [http-bio-80-exec-5] NutDaoExecutor - select * from advertisement where state=1 and PositionID=1
2019-05-12 16:33:20,020 DEBUG [http-bio-80-exec-5] UrlMappingImpl - Found mapping for [POST] path=/index/adv/advList : IndexController.getAdvList(IndexController.java:534)
2019-05-12 16:33:20,020 DEBUG [http-bio-80-exec-5] NutIoc - Get 'indexController'<class com.lewen.controllers.IndexController>
2019-05-12 16:33:20,020 DEBUG [http-bio-80-exec-5] NutDaoExecutor - select * from advertisement where state=1 and PositionID=2
3 回复

是所有sql都卡吗?

但你发的日志,是对外请求http超时,不是sql

我错了,确实是不是执行SQL的问题。执行完SQL做别的操作时候超时了。这个问题没有价值,我咋说没有类似的问题呢。

添加回复
请先登陆
回到顶部