20171012 tomcat 超时时间配置

原文链接:http://www.cnblogs.com/super-admin/p/7654720.html

Connector port="8080" protocol="HTTP/1.1"   

  •               connectionTimeout="20000"   
  •               redirectPort="8443" acceptCount="500" maxThreads="400" />  

connectionTimeout以毫秒为单位,默认设置为20秒。通过修改该参数,可以修改tomcat的请求超时时间;

 

maxThreads和acceptCount两个参数,

其中,maxThreads的介绍如下:

而acceptCount的介绍为:

所以两者的默认值分别是200和100,要调整Tomcat的默认最大连接数,可以增加这两个属性的值,并且使acceptCount大于等于maxThreads

转载于:https://www.cnblogs.com/super-admin/p/7654720.html

展开阅读全文
博主设置当前文章不允许评论。

超时时间已到。超时时间已到

11-05

各位能不能帮忙分析分析!rnrnrn[color=#FF0000]错误:超时时间已到。超时时间已到,但是尚未从池中获取连接。出现这种情况可能是因为所有池连接均在使用,并且达到了最大池大小[/color]rnrnrnrnrnpublic int SelectTeacherID(string UserName)rn rn SqlConnection con = new SqlConnection(ConfigurationManager.AppSettings["Connection"]);rn tryrn rn [color=#FF0000]con.Open();[/color] //错误rn string sql = "select id from UserInfo where UserName='" + UserName + "'";rn SqlCommand com = new SqlCommand(sql, con);rn SqlDataReader dr = com.ExecuteReader();rn dr.Read();rn int i = Convert.ToInt32(dr["id"].ToString());rn return i;rn dr.Close();rn rn finallyrn rn con.Close();rn con.Dispose();rn rn rnrn堆栈跟踪: rnrnrn[InvalidOperationException: 超时时间已到。超时时间已到,但是尚未从池中获取连接。出现这种情况可能是因为所有池连接均在使用,并且达到了最大池大小。]rn System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +1261381rn System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +105rn System.Data.SqlClient.SqlConnection.Open() +111rn Sqlselete.SelectTeacherID(String UserName) in d:\OA\OA\App_Code\Sqlselete.cs:210rn CalendarManage_MyCalendar.calSchedule_DayRender(Object sender, DayRenderEventArgs e) in d:\OA\OA\CalendarManage\MyCalendar.aspx.cs:91rn System.Web.UI.WebControls.Calendar.OnDayRender(TableCell cell, CalendarDay day) +423rn System.Web.UI.WebControls.Calendar.RenderDays(HtmlTextWriter writer, DateTime firstDay, DateTime visibleDate, CalendarSelectionMode selectionMode, Boolean buttonsActive, Boolean useAccessibleHeader) +2464rn System.Web.UI.WebControls.Calendar.Render(HtmlTextWriter writer) +1142rn System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +53rn System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +310rn System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +24rn System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +199rn System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +21rn System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) +61rn System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output) +260rn System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +53rn System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +310rn System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer) +45rn ASP.calendarmanage_mycalendar_aspx.__Render__control1(HtmlTextWriter __w, Control parameterContainer) in d:\OA\OA\CalendarManage\MyCalendar.aspx:12rn System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +98rn System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +21rn System.Web.UI.Page.Render(HtmlTextWriter writer) +27rn System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +53rn System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +310rn System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +24rn System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +8371rnrn rnrnrnrn按网上各位大虾说的,加上con.Dispose();,但是还是没有用,这个界面只要多连接几次就会有问题rnrnrnrn 论坛

没有更多推荐了,返回首页