6.3 memcached command line options

The following list contains memcached command line options that are of particular interest or usefulness when working with ndbmemcache.

  • -E so_file

    Specifies an engine (module) to be dynamically loaded on startup by memcached (version 1.6 or later).

    If this option is not specified, memcached tries to load the default engine, which provides the same caching engine as used in memcached 1.4 and previous versions

    To load the NDB engine, use this option as shown here:

    -E /path/to/ndb_engine.so
  • -e "configuration_string"

    Specifies options for use by the loaded engine. Options are given as option=value pairs separated by semicolons. The complete string should be quoted to prevent the possibility that the shell might interpret the semicolon as a command separator. All options to be passed to the NDB memcached engine must be specified in this fashion, as shown in the following example:

    $> memcached -E lib/ndb_engine.so -e "connectstring=maddy:1186;role=dev"

    See Section 6.4, “NDB Engine Configuration” for a list of NDB memcached engine configuration options.

  • -t number_of_worker_threads

    Sets the number of worker threads to be used by memcached. Because memcached uses an event-driven model in which each worker thread should be able to saturate a CPU core, the number of worker threads should be approximately the same as the number of CPU cores that memcached is to use.

    In some cases, adding worker threads does not improve performance unless you also provide additional connections to NDB Cluster. The default (4 memcached threads and 2 cluster connections) should work in most cases.

  • -p tcp_port

    The default TCP port is port 11211.

  • -U udb_port

    The default UDP port is port 11211. Setting this option to 0 disables UDP support.

  • -h

    Causes memcached to print help information.

For general information memcached command line options, see the documentation at http://code.google.com/p/memcached/wiki/NewStart.