Thursday, April 16, 2015



Multitenancy is a feature that is available throughout WSO2 products. So when loading tenants the process may consume lot of resources, inorder to minimize generating heavy loads on PC resources. carbon products has tenant unloading capabilities.

The tenant unloading will take place if the idle time exceeds the predefined threshold. So Following is how to change the tenant idle threshold.

This is basically done using a Java Property. The default tenant unloading idle time is set to 30 minutes.

Inorder to change this open <Carbon Home>/bin/wso2server.sh and add the following Java property.


-Dtenant.idle.time=<time_in_minutes>


The complete Java properties set within wso2server.sh will look like following,


$JAVA_OPTS \
    -Dcom.sun.management.jmxremote \
    -classpath "$CARBON_CLASSPATH" \
    -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" \
    -Djava.io.tmpdir="$CARBON_HOME/tmp" \
    -Dcatalina.base="$CARBON_HOME/lib/tomcat" \
    -Dwso2.server.standalone=true \
    -Dcarbon.registry.root=/ \
    -Djava.command="$JAVACMD" \
    -Dcarbon.home="$CARBON_HOME" \
    -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager \
    -Djava.util.logging.config.file="$CARBON_HOME/repository/conf/etc/logging-bridge.properties" \
    -Dcarbon.config.dir.path="$CARBON_HOME/repository/conf" \
    -Dcomponents.repo="$CARBON_HOME/repository/components/plugins" \
    -Dconf.location="$CARBON_HOME/repository/conf"\
    -Dcom.atomikos.icatch.file="$CARBON_HOME/lib/transactions.properties" \
    -Dcom.atomikos.icatch.hide_init_file_path=true \
    -Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true \
    -Dcom.sun.jndi.ldap.connect.pool.authentication=simple  \
    -Dcom.sun.jndi.ldap.connect.pool.timeout=3000  \
    -Dorg.terracotta.quartz.skipUpdateCheck=true \
    -Djava.security.egd=file:/dev/./urandom \
    -Dfile.encoding=UTF8 \
    -DapplyPatches \
    -Dtenant.idle.time=10 \
    org.wso2.carbon.bootstrap.Bootstrap $*
    status=$?

Thanx for reading and drop a comment if you have any queries. 
Categories: ,

3 comments:

  1. Hi ,

    Is it better to increase the idle time out to 1 day (1440 min) as we have performance issues due to this getting reloaded.

    Thanks,
    Ramya

    ReplyDelete
    Replies
    1. If you have sufficient resources Its fine to keep the tenant loaded.

      Delete

Subscribe to RSS Feed Follow me on Twitter!