第一:你们配置的tomcat最大连接数是多少?我是配置server.xml中
<Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
port="8080" minProcessors="10" maxProcessors="1000"
enableLookups="false" redirectPort="8443"
acceptCount="1000" debug="0" connectionTimeout="30000"
useURIValidationHack="false" disableUploadTimeout="true" />
的,把maxProcessors 和acceptCount配大的,
听说在Linux 中,tomcat只能配置最大为一千个线程,也就是说同时并发只能处理一千个并发访问量,而且受Linux操作系统地限制,我想这限制是要如何修改,我的服务器配置是2.4G的CPU,4G的内存
第二:我是通过Struts-config.xml中配置数据库连接池的我用的是Struts框架作的系统,我在每个action类中是这样调用连接池的 public ActionForward executeAction(ActionMapping actionMapping, ActionForm actionForm, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) {
//获取数据库连接池;
DataSource datasource=this.getDataSource(httpServletRequest,Constants.ilinkDB_KEY);
Connection conn=datasource.getConnection();每个action类,我都是这样调用连接池的,
有没有别的更好的方法还有就是如果不是action类中,其它新建的普通变,我要通过什么方法,来调用struts-config.xml中配置的连接池
<Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
port="8080" minProcessors="10" maxProcessors="1000"
enableLookups="false" redirectPort="8443"
acceptCount="1000" debug="0" connectionTimeout="30000"
useURIValidationHack="false" disableUploadTimeout="true" />
的,把maxProcessors 和acceptCount配大的,
听说在Linux 中,tomcat只能配置最大为一千个线程,也就是说同时并发只能处理一千个并发访问量,而且受Linux操作系统地限制,我想这限制是要如何修改,我的服务器配置是2.4G的CPU,4G的内存
第二:我是通过Struts-config.xml中配置数据库连接池的我用的是Struts框架作的系统,我在每个action类中是这样调用连接池的 public ActionForward executeAction(ActionMapping actionMapping, ActionForm actionForm, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) {
//获取数据库连接池;
DataSource datasource=this.getDataSource(httpServletRequest,Constants.ilinkDB_KEY);
Connection conn=datasource.getConnection();每个action类,我都是这样调用连接池的,
有没有别的更好的方法还有就是如果不是action类中,其它新建的普通变,我要通过什么方法,来调用struts-config.xml中配置的连接池
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货