Chapter 5. Configuration Guide

Red Hat recommends making these configuration settings on the Web servers to optimize for performance. Most of these settings are configurable through the enterprise.init file, by using the ccm tool (refer to Chapter 4 The ccm Command-Line Tool for more information), or at various places in the operating system.

5.1. Common Settings

All Red Hat Content Management System deployments, whether they are single-server systems or a multiple-server systems, should use these common settings.

5.1.1. Operating System

Lucene is very intense in its use of file handles. For systems that run Lucene, allocate 8192 file handles per process and set a system-wide limit of 32768. On Red Hat Enterprise Linux, set the following files:

# in /etc/security/limits.conf add
servlet         soft    nofile  8192
servlet         hard    nofile  8192

# in /etc/sysctl.conf add
fs.file-max = 32768

5.1.2. JVM Settings

If you use the IBM JVM, Red Hat recommends you set JAVA_OPTS in the shell or in $CCM_HOME/conf/envvars to:

JAVA_OPTS="-Xms768m -Xmx768m -Xgcpolicy:optthruput"

This allocates 768 MB of memory to the Java heap. If the Web servers require more memory and have extra capacity, adjust this number accordingly.

5.1.3. ccm Settings

Red Hat recommends making the following settings for performance reasons:

Disable Logging

In $CCM_HOME/conf/log4j.properties, add the following:

log4j.rootCategory=FATAL, console
Increase DB Connections to 200

Set the parameter waf.runtime.jdbc_pool_size=200, and load it one of two ways:

# Set the parameter
ccm set waf.runtime.jdbc_pool_size=200

# Load the parameter
ccm get waf.runtime.jdbc_pool_size=200

Alternately, you can put this in a parameter file and load it when doing ccm load.

If the server bottlenecks on database connections, then allocate additional connection threads in the database and update the waf.runtime.jdbc_pool_size entry accordingly.

Disable developer support

Remove the developer support initializer or set it to inactive:

init com.arsdigita.webdevsupport.Initializer {
  active = false;
}

You only need to use developer support when actively debugging. For this reason, you may want to set the value to false, and keep the capability around for when you really need it.

Use Saxon

Set the following in the shell or in $CCM_HOME/conf/envvars:

JAVA_TRANSFORMER_FACTORY="com.icl.saxon.TransformerFactoryImpl"
Turn off assertions

Set the following in the shell or in $CCM_HOME/conf/envvars:

 CCM_ASSERT_ENABLED=0
Turn off debug mode
ccm set waf.debug=false

5.1.4. Database Settings

5.1.4.1. Oracle Database Settings

If your deployment is using Oracle Database, make the following entry in the init.ora file to improve the SQL parsing ratio:

session_cached_cursors = 150

Setting the following parameter in init.ora may improve query plans:

optimizer_mode=FIRST_ROWS

Use the UTF8 character set when creating the database. Also, make sure the NLS_LANG environment variable is properly set:

NLS_LANG=AMERICAN_AMERICA.UTF8

5.1.4.2. Postgres Settings

If the deployment is using PostgreSQL, the following are recommended:

Changes to postgresql.conf

Increase the number of max_connections to 250 (or higher, depending upon the size of the server's database pool):

max_connections = 250

Increase the shared memory size so that there are at least 2000 shared_buffers and 1000 max_fsm_relations. Additionally, set aside 100,000 max_fsm_pages for each 1 GB of database storage:

shared_buffers = 2000
max_fsm_relations = 1000
max_fsm_pages = 100000      # 100k for every 1 GB of db storage

If the server has to sort large amounts of data when querying, consider increasing the sort_mem size.

CautionCaution
 

Setting this value too high can cause the database to run out of memory under higher loads.

sort_mem = 1024
cron jobs

Set up a cron job to run a PostgreSQL VACUUM of the database daily. For more information, see http://www.redhat.com/docs/manuals/database/RHDB-2.1-Manual/admin_user/routine-vacuuming.html.

Current versions of the PostgreSQL JDBC driver also are very inefficient at uploading and downloading BLOBs. The PostgreSQL JDBC driver that ships with Red Hat WAF addresses these issues. However, the pg_largetables table can grow very large with this driver. Set up a cron job to VACUUM the pg_largetables hourly to address this problem.

You can resolve this using the tools provided in the PostgreSQL RPMs for cron job and daily backups.

File handles

To prevent PostgreSQL from running out of file handles, put the following in /etc/security/limits.conf and add the changes to /etc/sysctl.conf if they are not already present:

# in /etc/security/limits.conf add
postgres        soft    nofile  8192
postgres        hard    nofile  8192

# in /etc/sysctl.conf add
fs.file-max = 32768
initdb locale settings

Searching in the CMS database requires an index which has optimizations for the LIKE operator. To enable these optimizations for PostgreSQL 7.3.x, you must initialize the default locale for the database as C. To do this, first set your environment to C, then initialize the database. initdb will pick up the environment variable and use it to set the collation order for the index.

LANG=C
initdb --no-locale

If you are using PostgreSQL 7.4.x, you will need to research the current capabilities and methods of LIKE usage with your index. Building under a non C locale may require building your index with additional options. You can start with these references:

http://www.postgresql.org/docs/7.4/static/indexes-types.html
http://www.postgresql.org/docs/7.4/static/indexes-opclass.html