5.3. Debug Settings

If you are having problems with your server installation or otherwise wish to turn on debugging, there are several debug configuration options:

Debug Logging

In log4j.properties, increase the logging levels in the logging initializer to info or debug. Either set the default priority to one of these levels, or do so for a particular Java class or package:

log4j.rootCategory=INFO, console
log4j.logger.com.arsdigita.db=DEBUG
Developer Support

For each page request, the Developer Support package records information such as stack traces, database queries, and timing details. Enable the Developer Support package to look at detailed request information.

CautionCaution
 

This package should normally be disabled on a production system as it slows performance and consumes significant amounts of memory.

To use developer support, activate the initializer in enterprise.init:

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

5.3.1. System Tuning

If your system is encountering performance, memory, or scalability issues, there are several suggested techniques to analyze and investigate the problem.

  1. Isolate the problem to the database or application services. The top command on Red Hat Enterprise Linux is useful for this purpose. If there is high CPU usage on the application services relative to the database services, or vice versa, then you have an area to focus on.

  2. If the problem is with the database server, turn on developer support and identify redundant or slow queries. Once these queries are identified, caching, denormalization, query optimization, and/or creating indexes should improve performance.

    If the problem is with the application server, systen profiling is recommended. To isolate application bottlenecks or memory usage, use a profiler such as OptimizeIt (http://www.borland.com/optimizeit/) or JProbe (http://java.quest.com/jprobe/jprobe.shtml).

  3. If there appears to be memory pressure, turning on verbose logging for garbage collection can be helpful. Each JVM has a different way to turn on verbose garbage collection. With the IBM JVM, start your server with java -verbose:gc, which will log all garbage collection activity to your server log file.