Call us: +1-415-738-4000

Default Settings for Terracotta Distributed Ehcache

Introduction

A number of properties control the way the Terracotta Server Array and Ehcache clients perform in a Terracotta cluster. Some of these settings are found in the Terracotta configuration file (tc-config.xml), while others are found in the Ehcache configuration file (ehcache.xml). A few must be set programmatically.

The following sections detail the most important of these properties and shows their default values. To confirm the latest default values for your version of Terracotta software, see the XSD included with your Terracotta kit.

Terracotta Server Array

A Terracotta cluster is composed of clients and servers. Terracotta properties often use a shorthand notation where a client is referred to as "l1" and a server as "l2".

These properties are set at the top of tc-config.xml using a configuration block similar to the following:

<tc-properties>
   <property name="l2.nha.tcgroupcomm.reconnect.enabled" value="true" />
<!-- More properties here. -->
</tc-properties>

See the Terracotta Server Arrays documentation for more information on the Terracotta Server Array.

Reconnection and Logging Properties

The following reconnection properties are shown with default values. These properties can be set to custom values using Terracotta configuration properties (<tc-properties>/<property> elements in tc-config.xml).

PropertyDefault ValueNotes
l2.nha.tcgroupcomm.reconnect.enabledtrue

Enables server-to-server reconnections.
l2.nha.tcgroupcomm.reconnect.timeout5000ms

l2-l2 reconnection timeout.
l2.l1reconnect.enabledtrue

Enables an l1 to reconnect to servers.
l2.l1reconnect.timeout.millis5000ms

The reconnection time out, after which an l1 disconnects.
l1.max.connect.retries-1

The number of allowed reconnection tries from an l1 to an l2. Affects both initial and subsequent reconnection attempts. -1 allows infinite attempts.

tc.config.getFromSource.timeout30000ms

Timeout for getting configuration from a source. For example, this controls how long a client can try to access configuration from a server. If the client fails to do so, it will fail to connect to the cluster.
logging.maxBackups20

Upper limit for number of backups of Terracotta log files.
logging.maxLogFileSize512MB

Maximum size of Terracotta log files before rolling logging starts.

HealthChecker Tolerances

The following properties control disconnection tolerances between Terracotta servers (l2 <-> l2), Terracotta servers and Terracotta clients (l2 -> l1), and Terracotta clients and Terracotta servers (l1 -> l2).

l2<->l2 GC tolerance : 40 secs, cable pull/network down tolerance : 10secs

l2.healthcheck.l2.ping.enabled = true
l2.healthcheck.l2.ping.idletime = 5000
l2.healthcheck.l2.ping.interval = 1000
l2.healthcheck.l2.ping.probes = 3
l2.healthcheck.l2.socketConnect = true
l2.healthcheck.l2.socketConnectTimeout = 5
l2.healthcheck.l2.socketConnectCount = 10

l2->l1 GC tolerance : 40 secs, cable pull/network down tolerance : 10secs

l2.healthcheck.l1.ping.enabled = true
l2.healthcheck.l1.ping.idletime = 5000
l2.healthcheck.l1.ping.interval = 1000
l2.healthcheck.l1.ping.probes = 3
l2.healthcheck.l1.socketConnect = true
l2.healthcheck.l1.socketConnectTimeout = 5
l2.healthcheck.l1.socketConnectCount = 10

l1->l1 GC tolerance : 50 secs, cable pull/network down tolerance : 10secs

l1.healthcheck.l2.ping.enabled = true
l1.healthcheck.l2.ping.idletime = 5000
l1.healthcheck.l2.ping.interval = 1000
l1.healthcheck.l2.ping.probes = 3
l1.healthcheck.l2.socketConnect = true
l1.healthcheck.l2.socketConnectTimeout = 5
l1.healthcheck.l2.socketConnectCount = 13

Ehcache

Ehcache configuration properties typically address the behavior, size, and functionality of caches. Others affect certain types of cache-related bulk operations.

Properties are set in ehcache.xml except as noted.

General Cache Settings

The following default cache settings affect cached data. For more information on these settings, see the Ehcache documentation.

PropertyDefault ValueNotes
value modeSERIALIZATION
consistencyEVENTUAL
XAfalse
orphan evictiontrue
local key cachefalse
synchronous writefalse
memory store eviction policyLRU
ttl00 means never expire.
tti00 means never expire.
transactional modeoff
persistence strategynone
maxElementsOnDisk00 means infinite; this is the cache size on the Terracotta Server Array.
maxBytesLocalHeap0
maxBytesLocalOffHeap0
maxEntriesLocalHeap00 means infinite.

NonStop Cache

The following default settings affect the behavior of the cache when while the client is disconnected from the cluster. For more information on these settings, see the nonstop-cache documentation.

PropertyDefault ValueNotes
enablefalse
timeout behaviorexception
timeout30000ms
net.sf.ehcache.nonstop.bulkOpsTimeoutMultiplyFactor10 This value is a timeout multiplication factor affecting bulk operations such as removeAll() and getAll(). Since the default nonstop timeout is 30 seconds, it sets a timeout of 300 seconds for those operations. The default can be changed programmatically:

cache.getTerracottaConfiguration() .getNonstopConfiguration() .setBulkOpsTimeoutMultiplyFactor(10)

Bulk Operations

The following properties are shown with default values. These properties can be set to custom values using Terracotta configuration properties.

Increasing batch sizes may improve throughput, but could raise latency due to the load on resources from processing larger blocks of data.

PropertyDefault ValueNotes
ehcache.bulkOps.maxKBSize1MBBatch size for bulk operations such as putAll and removeAll.
ehcache.getAll.batchSize1000The number of elements per batch in a getAll operation.
ehcache.incoherent.putsBatchByteSize5MBFor bulk-loading mode. The minimum size of a batch in a bulk-load operation. Increasing batch sizes may improve throughput, but could raise latency due to the load on resources from processing larger blocks of data.
ehcache.incoherent.putsBatchTimeInMillis600 ms For bulk-loading mode. The maximum time the bulk-load operation takes to batch puts before flushing to the Terracotta Server Array.