Resin optimization Scheme

Source: Internet
Author: User
Tags xms


1. Add inside Session-config in resin.conf

<session-max>4096</session-max>

<session-timeout>30</session-timeout>

<enable-cookies>true</enable-cookies>

<enable-url-rewriting>true</enable-url-rewriting>

Session-max: Max Session Count

Session-timeout:session the expiration time, in minutes. Whether cookies are allowed: refers to whether the session uses cookies. If cookies are used, the browser must support the session to be used, and it is recommended to change to false when publishing. Enable-url-rewriting and enable-cookies are generally used together. If Enable-cookies is false,enable-url-rewriting should be set to true more appropriate

2.<dependency-check-interval>2s</dependency-check-interval>

Environment context detection time, for the production site, this to set a bit longer, for example, 600 seconds, 10 minutes

Resin Check the system configuration and the time interval of Java, JSP, resin.conf and other files.

The default value is 2 seconds, suitable for development and debugging environment, if the formal environment as far as possible to adjust the parameters or directly to 1, do not allow inspection, that is, the ban on hot deployment.

<DEPENDENCY-CHECK-INTERVAL>-1s</DEPENDENCY-CHECK-INTERVAL>

3. Set the thread-min,thread-max,thread-keepalive three parameters in the resin.conf file to a larger, 1000,3000, respectively, 1000, of course, this is based on your machine situation and possible simultaneous access to the number of decisions, if your site visits are large, should be properly enlarged.

Then look at the changes in the Java thread in the task Manager to see how big a thread is when the Java process is dropped. Mine is at around 379 when the fall.

The thread-min,thread-max,thread-keepalive is then written as 150,400,300, which means that the maximum value when it is dropped is slightly magnified as the value of Thread-max because the system generally does not exceed this value. Then the other two parameters are set according to the situation. the Accept-buffer-size value is set to a larger size, I set it to more than 10000, which allows Java to use more memory resources.

This setting is basically able to meet the normal operation of resin, when the loss of resin services greatly reduced

3. How do I specify the size of Java memory when resin is started?

–XMX setting JVM Max memory

- XMS set JVM minimum memory usage

Setting-xms and-xmx to the same size is a good choice to avoid reallocating memory every time the garbage collection completes

-XMS indicates the initial memory size at startup

-xx:maxnewsize=256m-xx:maxpermsize=256m: The size of the permanently saved area of memory

Better make-xmn about equal to-xmn 1/4.

By increasing the parameters "-xx:permsize" and "-xx:maxpermsize" to avoid a 500 error that occurs when the JVM memory is permanently saved by a zone overflow, the resin is raised. (Zheng that because of the spring+struts on the line, these frameworks use a lot of dynamic Class,classloader to store this part in PermGen space.) The JVM's GC does not clean up permgen space. This can easily result in an online application reporting PermGen space memory overflow. )

resin3.1 version, you only need to modify the resin.conf, the following configuration can

<jvm-arg>-Xmx2048m</jvm-arg>

<jvm-arg>-Xms1024m</jvm-arg>

<jvm-arg>-Xss1m</jvm-arg>

<jvm-arg>-Xdebug</jvm-arg>

<jvm-arg>-Dcom.sun.management.jmxremote</jvm-arg>

For size settings, it is recommended that you pass the memory test first and then set the maximum memory

4. How do I specify the size of Java memory when resin is started?

1. Memory Settings under window:-j "-server-xms500m-xmx1000m"

2. Linux configuration: args in resin3/bin/httpd.sh.


Resin optimization Scheme

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.