热门关键字:   安全硬件 智能手机 网吧技术 手机安全 防黑 服务器 数据库 局域网 信息化

巧妙设置resin3的优化配置

发布时间:2018-10-31 13:37文章来源:未知文章作者: 点击次数:
摘要:1、 dependency-check-interval 参数调整 resin检查系统配置及java、jsp、resin.conf等文件的时间间隔。 默认值为2秒,适合开发及调试环境,如果是正式环境尽量把参数调大或者直接改为-1,不允许

1、dependency-check-interval 参数调整
resin检查系统配置及java、jsp、resin.conf等文件的时间间隔。
默认值为2秒,适合开发及调试环境,如果是正式环境尽量把参数调大或者直接改为-1,不允许检查,也就是禁止了热部署。
<DEPENDENCY-CHECK-INTERVAL>-1s</DEPENDENCY-CHECK-INTERVAL>


 

2、缓存
改变cache-mapping的值:
<CACHE-MAPPING expires="5s" url-pattern="/" />
<CACHE-MAPPING expires="60s" url-pattern="*.gif" />
<CACHE-MAPPING expires="60s" url-pattern="*.jpg" />
<CACHE-MAPPING expires="60s" url-pattern="*.png" />
3、jvm优化
jvm需要根据你的系统配置及应用来调整。


 

JVM OPTION PASSED TO RESIN MEANING
-Xms initial java heap size
-Xmx maximum java heap size
-Xmn the size of the heap for the young generation


 

将-Xms和-Xmx设置为一样大小是不错的选择。
如: bin/httpd.sh -Xms500M -Xmx500M -Xmn100M


 

更多的关于jvm优化参数如:young generation、Eden generation、older generation可见
Sun documentation on garbage collection


 

jvm的监控,google一下有很多的工具,如:jconsole jstat jstack


 

jconsole的使用见我的另外一篇文章 《使用Jconsole对java的内存使用情况(JVM)进行监控》


 

$jps
1229 Jps
1003 Resin
973 resin.jar


 

$jmap 973
Attaching to process ID 973, please wait...
Debugger attached successfully.
Server compiler detected.
JVM version is 1.5.0_16-b02
0x0000000040000000 64K /home/jdk1.5.0_16/bin/java
0x00000030b2a00000 127K /lib64/ld-2.5.so
0x00000030b2e00000 1647K /lib64/libc-2.5.so
0x00000030b3200000 22K /lib64/libdl-2.5.so
0x00000030b3600000 600K /lib64/libm-2.5.so
0x00000030b3a00000 138K /lib64/libpthread-2.5.so
0x00000030b5a00000 111K /lib64/libnsl-2.5.so
0x00002aaab46ad000 26K /home/jdk1.5.0_16/jre/lib/amd64/libmanagement.so
0x00002aaab49de000 79K /home/jdk1.5.0_16/jre/lib/amd64/libnet.so
0x00002aeeac3c1000 9933K /home/jdk1.5.0_16/jre/lib/amd64/server/libjvm.so
0x00002aeeacd46000 43K /home/jdk1.5.0_16/jre/lib/amd64/native_threads/libhpi.so
0x00002aeeace61000 52K /lib64/libnss_files-2.5.so
0x00002aeead06c000 58K /home/jdk1.5.0_16/jre/lib/amd64/libverify.so
0x00002aeead17b000 171K /home/jdk1.5.0_16/jre/lib/amd64/libjava.so
0x00002aeead2a5000 78K /home/jdk1.5.0_16/jre/lib/amd64/libzip.so


 

jstat -gc 1489 1000 3
S0C S1C S0U S1U EC EU OC OU PC PU YGC YGCT FGC FGCT GCT
43648.0 43648.0 0.0 0.0 262208.0 101390.5 699072.0 18545.6 28032.0 15756.6 1 0.055 1 0.115 0.170
43648.0 43648.0 0.0 0.0 262208.0 101390.5 699072.0 18545.6 28032.0 15756.6 1 0.055 1 0.115 0.170
43648.0 43648.0 0.0 0.0 262208.0 101390.5 699072.0 18545.6 28032.0 15756.6 1 0.055 1 0.115 0.170


 

jstack 1489
Thread 1495: (state = BLOCKED)
- java.lang.Object.wait(long) @bci=0 (Interpreted frame)
- java.lang.Object.wait() @bci=2, line=474 (Interpreted frame)
- java.lang.ref.Reference$ReferenceHandler.run() @bci=46, line=116 (Interpreted frame)


 

Thread 1489: (state = IN_NATIVE)
- java.net.SocketInputStream.socketRead0(java.io.FileDescriptor, byte[], int, int, int) @bci=0 (Interpreted frame)
- java.net.SocketInputStream.read(byte[], int, int) @bci=84, line=129 (Interpreted frame)
- java.net.SocketInputStream.read() @bci=23, line=182 (Interpreted frame)
- com.caucho.server.resin.Resin.waitForExit() @bci=304, line=1265 (Interpreted frame)
- com.caucho.server.resin.Resin.main(java.lang.String[]) @bci=42, line=1367 (Interpreted frame)
 


 

上一篇:IIS下用ISAPI_REWRITE配制防盗链
下一篇:修改IIS7的上传文件大小限制

热点推荐