resin.conf configurationResin 3.0
Resin

Change Log
Documentation

Orientation
Features
Installation
Configuration
Web Applications
JSP
Servlets and Filters
Databases
Admin (JMX)
Security
XML and XSLT
XTP
Resources (JNDI)
Performance
Protocols
Third-party
Troubleshooting

env
web-app
resin.conf
log
el vars
init
index
Common Tasks
Relax Schema
Config FAQ
Scrapbook
web-app
Configuration
log

Description of the resin.conf configuration.

  1. resin.conf
    1. access-log
    2. cache
    3. document-directory
    4. group-name
    5. host
    6. cluster
    7. connection-pool
    8. http
    9. min-free-memory
    10. resin
    11. root-directory
    12. server
    13. srun
    14. user-name

resin.conf

access-log

Resin 3.0

child of: server, host

Specifies the access log file.

AttributeMeaningdefault
pathThe access log path.required
formatAccess log format.see below
resin:typeClass implementing AbstractAccessLog for custom logging.
rollover-periodhow often to rollover the log. Normally in days (15D), weeks (2W) or months (1M).none
rollover-sizemax size of the log before a rollover.10 meg
archive-formatformat the name of the archive file.n/a

The rollover-period variable controls how often the access log will be rotated. When the time runs out, Resin will move the old log file to a timestamped one, e.g. access.log20001114. Rollovers happen at midnight in the local time if the time period is a day or longer.

The access log formatting variables follow the Apache variables:

%bresult content length
%hremote IP addr
%{xxx}irequest header xxx
%{xxx}oresponse header xxx
%{xxx}ccookie value xxx
%nrequest attribute
%rrequest URL
%sstatus code
%{xxx}trequest date with optional time format string.
%Ttime of request in seconds
%uremote user
%Urequest URI

The default format is:

"%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\""

<server>

  <access-log id='log/access.log'>
    <rollover-period>2W</rollover-period>
  </access-log>

 ...

</server>

If the web-app doesn't specify an access-log, it will use the host's access-log.

cache

Resin 3.0

child of: server

Configures Resin's internal HTTP proxy cache. Resin's cache can dramatically improve performance by avoiding re-evaluation of slowly changing database-backed changes. We strongly recommend using the proxy caching when possible for a simple, standards-based performance boost.

Using the proxy cache is described more fully in the caching documentation.

AttributeMeaningdefault
pathfilesystem location of the cacherequired
enableenables/disables the cachetrue
entriesmax number of entries allowed in the cache1024
memory-sizemax size of the cache saved in memory1M
disk-sizemax size of the cache saved on disk64M

document-directory

Resin 3.0

child of: host, web-app

Configures the directory where web pages will be placed when using webserver-style deployment instead of war-based deployment.

group-name

Resin 3.0

child of: resin

Configures the Unix setuid group name used after Resin binds the reserved ports as root.

Note, Linux requires the new thread package (e.g. RedHat 9.0 or later) to support group-name.

host

Resin 3.0

child of: server

Configures a virtual host. Virtual hosts must be configured explicitly.

AttributeMeaningdefault
idprimary host namenone
regexpRegular expression based host matchingnone
host-nameCanonical host namenone
host-aliasAliases matching the same hostnone
secure-host-nameHost to use for a redirect to SSLnone
root-directoryRoot directory for host filesparent directory
document-directoryDocument directory rootroot-directory

cluster

Resin 3.0

child of: server

Defines the cluster of Resin JVMs used for load-balancing and for sharing distributed sessions.

<cluster>
  <srun id="a" host="192.168.0.1" port="6802" index="1"/>
  <srun id="b" host="192.168.0.2" port="6802" index="2"/>
</cluster>

connection-pool

Resin 3.0

child of: server

Configures the thread pool shared among all ports.

AttributeMeaningdefault
thread-maxmaximum number of working threads200
spare-thread-maxmaximum number of spare working threads20
spare-thread-minminimum number of spare working threads5

<thread-max> is the absolute maximum number of connection worker threads allowed. <thread-max> may be limited by OS/JVM restrictions, especially the stack size. -Xss and/or ulimit -s may be required for large numbers of threads, e.g. "ulimit -s 2048" on some versions of Linux would allow for 1024 total threads in the JVM.

<spare-thread-max> and <spare-thread-min> configure Resin's adaptive thread pooling. Resin tries to keep between <spare-thead-min> and <spare-thread-max> idle threads available at all time. Sites with large spikes in connection loads may need to increase the <spare-thread-min> value.

http

Resin 3.0

child of: server

Configures a HTTP port listening for HTTP requests.

When configuring multiple JVMs, each <http> will have a unique <server-id> which allows the -server command-line to select which ports the server should listen to.

AttributeMeaningdefault
server-idserver id matching the -server command linenone
hosthostname of the interface to listen to*
portport to listen torequired
tcp-no-delaysets the NO_DELAY socket parametertrue
virtual-hostforces all requests to this <http> to use the named virtual hostnone
opensslconfigures the port to use OpenSSLnone
jsse-sslconfigures the port to use JSSE for SSLnone

min-free-memory

Resin 3.0

child of: resin
default: 1M

For reliability, Resin periodically checks the amount of free memory available. When the free memory drops below <min-free-memory>, even after garbage collection, Resin will force a JVM restart.

In general, application developers should use a heap profiler to eliminate memory leaks and OutOfMemoryErrors. Because an OutOfMemoryError can cause severe problems with the application, Resin detects the low memory before those errors can be thrown.

resin

Resin 3.0

Top-level configuration for the resin.conf file. The <resin> tag needs to specify the Resin namespace, to allow for validation of the configuration file.

The environment of the top-level <resin> is the global classpath. This environment can be important for <log> configuration for threads which run with using only the global class loader. Because the <resin> environment does not have a dynamic class loader, dynamically loaded classes, like custom jars in resin/lib are not available.

resin
<resin xmlns="http://caucho.com/ns/resin">
  <server>
    <http id='' host='*' port='8080'/>

    <resin:include path="app-default.xml"/>

    <host id=""/>
      <web-app id="/"/>
    </host>
</resin>

root-directory

Resin 3.0

child of: server, host

Specifies the root directory for the <server> and <host> contexts. All EL-style directory paths are relative to the root-directory.

server

Resin 3.0

child of: resin

Main configuration for the server, configuring ports, threads and virtual hosts.

  • Common resources for all virtual hosts and web-apps.
  • Thread pooling
  • HTTP and SRUN/Cluster ports
  • Caching
  • virtual host configuration and common web-app-default

The <server> will generally contain a <class-loader> configuration which loads the resin/lib jars dynamically, allowing for system-wide jars to be dropped into resin/lib. <server> configures the main dynamic environment. Database pools common to all virtual hosts, for example, should be configured in the <server> block.

The <server> configures the <thread-pool> and a set of <http> and <srun> ports which share the thread pool. Requests received on those ports will use worker threads from the thread pool.

srun

Resin 3.0

child of: cluster

Configures a clustered HMUX listener.

When configuring Resin in a load-balanced cluster, each Resin instance will have its own <srun> configuration, which Resin uses for distributed session management and for the load balancing itself.

When configuring multiple JVMs, each <srun> will have a unique <server-id> which allows the -server command-line to select which ports the server should listen to.

AttributeMeaningdefault
server-idserver id matching the -server command linenone
hosthostname of the interface to listen to*
portport to listen torequired
indexSession index of the srunrequired
backupIf true, the server is generally used as a backupfalse
tcp-no-delaysets the NO_DELAY socket parametertrue
virtual-hostforces all requests to this <http> to use the named virtual hostnone
opensslconfigures the port to use OpenSSLnone
jsse-sslconfigures the port to use JSSE for SSLnone

user-name

Resin 3.0

child of: resin

Configures the Unix setuid user name used after Resin binds the reserved ports as root.

Note, Linux requires the new thread package (e.g. RedHat 9.0 or later) to support user-name.


web-app
Configuration
log
Copyright © 1998-2003 Caucho Technology, Inc. All rights reserved.
Resin® is a registered trademark, and HardCoretm and Quercustm are trademarks of Caucho Technology, Inc.