
有个servlet继承于singlethreadmodel,当同时有多个请求时tomcat会否有机制会主动生成多个实例去处理请求呢? 在哪儿可以配置这个东西吗 谢谢
by zhengangzhu - 服务器应用 - 2008-08-26 13:46:18 阅读(1821) 回复(0)
[code]
session_register("count");//注册一个session变量
$_session[count]++;//session变量加1
echo "
;";
echo session_id()."
;
;";
echo "显示session值:".$_session["count"];
?>;
在Web的Application中 web.xml里设置 <session-config> <session-timeout>30session-timeout> session-config> 但是当申请一个页面,然后刷新几次页面,发现session Id变化了 或者不到30分钟不动页面,发现session Id也变化了 不能理解以上现象,请高手们指点迷津,谢谢! [ 本帖最后由 ouyingyufei 于 2007-1-9 18:42 编辑 ]
在一台服务器上有tomcat,这两个tomcat之间需要session复制。我按照tomcat doc里面的说明,配置好了session复制。但是不起作用。大家都是用什么方法进行tomcat的session复制的啊?
下面是我的server.xml里面关于session复制的配置
我在tomcat里面已经作了如下设置 <session-config> <session-timeout>30session-timeout> session-config> 但是session还是没有按时清除。怎么回事,我的tomcat版本是5.5.17 [ 本帖最后由 HonestQiao 于 2006-6-2 11:21 编辑 ]
mod_jk为tomcat-connectors-1.2.27
当某个tomcat挂掉时,前台原来访问此tomcat的请求,被转移到同组内的其它tomcat上。
此时,这个请求会发给组内的其它tomcat。每个tomcat都会回应这个请求。
怎样能让这个请求发给组内的其它tomcat,并在其中一个tomcat对其回应后,剩下的tomcat就不再对此请求做出回应呢?
---->
这个问题可以这样解决:
在tomcat的server.xml中
由于session值之前没有设置,以至于刚登录的网站,不到一分钟就超时了,总结了一下,原来是session过期的原因,以下是设置session时间的3个方法: 1. 在tomcat-->conf-->servler.xml文件中定义: defaultsessionTimeOut="3600" 2. 在web.xml中定义: 20 3. 在程序中定义: session.setMaxInactiveInterval(30*60); 设置单位为秒,设置为-1永不过期 不知道这种设置会不会真正地起到作用的哦! 本文来自C...
在5.5文档中有说明 In this release of session replication, tomcat performs an all-to-all replication of session state. This is an algorithm that is only efficient when the clusters are small. For large clusters, the next release will support a primary-secondary session replication where the session will only be stored at one or maybe two backup servers. 在5.5中只支持session 在所有节点复制,这个应该...
1. 在\conf\web.xml中通过参数指定: session-config> session-timeout>180session-timeout> session-config> 单位为分钟。 2. 在程序中通过servlet api直接修改: Httpsession session = request.getsession(); session.setMaxInactiveInterval(180*60); 单位为秒,设置为-1永不过期。 本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u1/41559/showart_538022.html