resin 3.1使用总结.

  使用resin已经有四、五年了,但以前都是做一些小系统,resin的压力并不大,近段时间做一个大系统,日平均ip上10万,resin的压力非常的大,除了对程序做优化以外,resin 的优化也小不了。

 

 

一、优化配置

  修改 conf/resin.conf 文章中的 JVM参数

 

<jvm-arg>-Xms512m</jvm-arg>
<jvm-arg>-Xss128k</jvm-arg>
<jvm-arg>-Xmn184m</jvm-arg>
<jvm-arg>-XX:ParallelGCThreads=20</jvm-arg>
<jvm-arg>-XX:+UseConcMarkSweepGC</jvm-arg>
<jvm-arg>-XX:+UseParNewGC</jvm-arg>
<jvm-arg>-Xdebug</jvm-arg>
<jvm-arg>-Xloggc:gc.log</jvm-arg>

 

  修改 最大thread-max为2500

      <!– Maximum number of threads. –>
      <thread-max>2500</thread-max>

      <!– Configures the socket timeout –>
      <socket-timeout>65s</socket-timeout>
        
      <!– Configures the keepalive –>
      <keepalive-max>10240</keepalive-max>
      <keepalive-timeout>30s</keepalive-timeout>

 

二、利用resin-admin监控resin运行情况。


 

第一行是Thread pool情况,如果发现Peak大于thread max,就应该修改conf/resin.conf 中的thread-max,相应的增大thread-max。

第二行是Threads,如果长期出现在这里而又不是SUN的方法,或者resin的方法的话,就要对这些方法进行测试、优化。

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.