resin.conf 配置
<jvm-arg>-Xmx3g</jvm-arg>
<jvm-arg>-Xss1M</jvm-arg>
<jvm-arg>-XX:MaxPermSize=512M</jvm-arg>
<jvm-arg>-Xdebug</jvm-arg>
<memory-free-min>24M</memory-free-min>
<thread-max>10240</thread-max> 主要是这个一般设置都是256
<socket-timeout>65s</socket-timeout>
<keepalive-max>128000</keepalive-max>
<keepalive-timeout>20s</keepalive-timeout>
我们的版本是 3.1.10的 普通版本.
用反编译的工具看了下resin.jar相应的类
com.caucho.server.port.Port:
public class Port
implements EnvironmentListener, Runnable
{
private static final L10N L;
private static final Logger log;
private static final int DEFAULT = -51966;
private FreeList<TcpConnection> _freeConn = new FreeList(32);
private ProtocolDispatchServer _server;
private String _serverId = "";
private String _address;
private int _port;
private Protocol _protocol;
private SSLFactory _sslFactory;
private boolean _isSecure;
private InetAddress _socketAddress;
private int _acceptThreadMin = -51966;
private int _acceptThreadMax = -51966;
private int _acceptListenBacklog = -51966;
private int _connectionMax = -51966;
private int _keepaliveMax = -51966;
没有对com.caucho.server.port.Port的 _connectionMax 进行修改。因为测试并发每秒10000并发没有导致resin挂掉。主要就改了resin配置文件中的 <thread-max>10240</thread-max>
网上说:
如果使用 resin普通版 需要你查看com.caucho.server.port.Port。
private int _connectionMax = 512 ; 改为 10240
如果不改有可能当测试访问量达到512时,系统无法接受新的请求。
编译成功后替换resin.jar,重启resin服务
-------------------------------------------------------------------------------------------------------------------
resin pro 版本的 和resin 普通版本的文件是一样的
不同的地方就是pro 版本多了两个包pro.jar 和license.jar包,且pro收费!