Java开发网 Java开发网
注册 | 登录 | 帮助 | 搜索 | 排行榜 | 发帖统计  

您没有登录

» Java开发网 » Application Server » Other AS  

按打印兼容模式打印这个话题 打印话题    把这个话题寄给朋友 寄给朋友    该主题的所有更新都将Email到你的邮箱 订阅主题
flat modethreaded modego to previous topicgo to next topicgo to back
作者 Resin的优化
javadd





发贴: 736
积分: 77
于 2006-05-12 21:47 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
Resin启动时通过bin目录下的wrapper.pl文件进行控制,我们可以修改这个文件来加一些参数,比如要加入Java的-Xms和-Xmx参数

进行
vi /usr/local/resin-2.1/bin/wrapper.pl
找到并修改以下这行为:
$JAVA_ARGS="-Xms512m -Xmx512m";

具体参数请根据自己的应用进行调节


javadd edited on 2006-05-13 09:40


作者 Re:Resin的群集 [Re:javadd]
javadd





发贴: 736
积分: 77
于 2006-05-13 09:18 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
单台Web Server+多个JVM

当有多台服务器时, 可以把负载均衡到一台Web Server和多个JVM上, 这比用路由器或防火墙实现负载平衡较为廉价,最主要的优点是采用Resin自己的负载平衡机制,可以保证使同一个session停留在同一台计算机上.

配置例子:

<caucho.com>
<http-server>
<srun id="1" host='host1' port='6802' srun-index='1'/>
<srun id="2" host='host2' port='6802' srun-index='2'/>
<srun id="3" host='host3' port='6802' srun-index='3'/>
...
</http-server>
</caucho.com>

在各台机器上启动resin就可以了,Resin会对具体请求的Session进行编码,当同一个用户第二次请求时,会用同一台机器进行处理。


javadd edited on 2006-05-13 09:27


作者 Resin的群集 [Re:javadd]
javadd





发贴: 736
积分: 77
于 2006-05-13 09:18 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
单机配置

单台机器上运行一个Web Server和两个JVM. 其中一个是主JVM, 另一个是备份JVM, 如果主JVM失效(服务中断或崩溃), 将启用后备JVM维持Servlet Engine仍然可用,在resin.conf中的相应配置例子如下:

caucho.com>
<http-server>
<srun id="a" host='localhost' port='6802' srun-index='1'/>
<srun-backup id="b" host='localhost' port='6803' srun-index='2'/>

...

启动时应该分别单独地启动这两个sun进程. 例如unix下:

linux> httpd.sh -pid srun1.pid -server a start
linux> httpd.sh -pid srun2.pid -server b start

在NT下:

c:\resin1.2> bin/httpd -install-as ResinA -server a
c:\resin1.2> bin/httpd -install-as ResinB -server b

但在启动后,只有6802接受处理请求,当6802的JVM失效时,Resin会自动将请求交给6803备份JVM处理。


javadd edited on 2006-05-13 09:41


作者 Re:Resin的优化 [Re:javadd]
javadd





发贴: 736
积分: 77
于 2006-05-13 09:54 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
群集配置详见:
http://www.caucho.com/resin-3.0/config/tcp-sessions.xtp


javadd edited on 2006-05-13 10:33


作者 Re:Resin的优化 [Re:javadd]
javadd





发贴: 736
积分: 77
于 2006-05-13 10:33 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
当不需要改动程序时,关闭java自动编译会更快些.

<compiling-loader path="webapps/WEB-INF/classes" />
加个属性
batch="false"




作者 Re:Resin的优化 [Re:javadd]
javadd





发贴: 736
积分: 77
于 2006-05-18 08:55 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
$JAVA_ARGS="-server";

据说java中的-server参数是让本地化编译更完全.





flat modethreaded modego to previous topicgo to next topicgo to back
  已读帖子
  新的帖子
  被删除的帖子
Jump to the top of page

   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923