tomcat6.0+mysql5.0+jsp 网站数据库查询速度越来越慢
服务器是:4核 ,2.4G+8G内存
刚启动服务器时查询速度很快,过了20分钟就慢的想哭了,
重启TOMCAT又好了,
查看TOMCAT日志,没看见有数据库连接的错误提示,提示的是这个Exception initializing page context
java.lang.IllegalStateException: Cannot create a session after the response has been committed
at org.apache.catalina.connector.Request.doGetSession(Request.java:2284)
at org.apache.catalina.connector.Request.getSession(Request.java:2066)
at org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:833)
at javax.servlet.http.HttpServletRequestWrapper.getSession(HttpServletRequestWrapper.java:216)
其他的基本没有了,不知为啥,请高手帮忙看下啊!!!
另外数据库连接可以肯定的是都关了!
我的tomcat是安装版,直接通过windows 2003服务启动的!
如果是tomcat或者是mysql的配置问题,麻烦讲解,

解决方案 »

  1.   

    http://apps.hi.baidu.com/share/detail/14557440
      

  2.   

    ServletOutputStream out = response.getOutputStream();
    // 最好这样紧挨着 response.getOutputStream()
    Servlet里没有用到都
      

  3.   

    request.getSession().setAttribute(key,value);
      

  4.   

    我的意思是你看看是不是在响应后才创建的session,问题我也是查出来得,项目经验少,没遇到过,共同学习下