Standalone Tomcat Memcached Plugin

  • Tags: /
  • Latest: 0.1
  • Last Updated: 14 May 2013
  • Grails version: 2.0 > *
0 vote
compile ":standalone-tomcat-memcached:0.1"
Custom repositories:
mavenRepo ""

 Documentation  Source  Issues


Uses Memcached as the Tomcat session manager when using the Tomcat server


Changes the Tomcat session manager to one that uses Memcached.

Install by adding a dependency in BuildConfig.groovy:

plugins {
   build ':standalone:1.2.1'
   compile ':standalone-tomcat-memcached:0.1'

Note that the plugin doesn't explicitly depend on the standalone plugin, but was designed to be used with it to change the session manager to one using Memcached for environments such as Heroku.


By default the session manager will be configured to use Memcached running on localhost, on the standard port, and with no username or password. To change any of these values from the default, add settings to Config.groovy:

PropertyDefault ValueMeaning
grails.plugin.standalone.tomcat.memcached. memcachedNodes'localhost:11211'comma- or space-delimited memcached node addresses
grails.plugin.standalone.tomcat.memcached. enabledtruewhether the manager is enabled or not
grails.plugin.standalone.tomcat.memcached. enableStatisticstruewhether to enable statistics gathering
grails.plugin.standalone.tomcat.memcached. sessionBackupAsyncfalseif true session backups are done asynchronously
grails.plugin.standalone.tomcat.memcached. stickyfalseif true use sticky sessions
grails.plugin.standalone.tomcat.memcached. memcachedProtocol'binary'the protocol to use, either 'binary' or 'text'
grails.plugin.standalone.tomcat.memcached. sessionBackupTimeout100the timeout in milliseconds after which a session backup is considered as being failed
grails.plugin.standalone.tomcat.memcached. operationTimeout1000the operation timeout used at various places, e.g. used for the spymemcached ConnectionFactory
grails.plugin.standalone.tomcat.memcached. backupThreadCountthe number of CPU coresthe number of threads that are used for asynchronous session backup (if enabled)
grails.plugin.standalone.tomcat.memcached. copyCollectionsForSerializationfalseif true iterate over a copy of collection elements
grails.plugin.standalone.tomcat.memcached. usernamenoneauthentication username
grails.plugin.standalone.tomcat.memcached. passwordnoneauthentication password
grails.plugin.standalone.tomcat.memcached. failoverNodesnonethe ids of nodes to not use for session backup, but only if no other nodes are available
grails.plugin.standalone.tomcat.memcached. lockingModenonethe locking strategy for non-sticky sessions
grails.plugin.standalone.tomcat.memcached. requestUriIgnorePatternnonea regular expression for request URIs that shall not trigger a session backup (e.g. static resources)
grails.plugin.standalone.tomcat.memcached. sessionAttributeFilternonea regular expression for which session attributes are serialized
grails.plugin.standalone.tomcat.memcached. transcoderFactoryClass'de.javakaffee.web.msm. JavaSerializationTranscoderFactory'the class name of the factory that creates the transcoder to use for serializing/deserializing sessions to/from memcached
grails.plugin.standalone.tomcat.memcached. customConvertertruethe class name of the custom converter to provide custom serialization of application-specific types

More information about configuring the manager is available here