memcached man page

memcached — high-performance memory object caching system

Synopsis

memcached [options]

Description

This manual page documents briefly the memcached memory object caching daemon.

memcached is a flexible memory object caching daemon designed to alleviate database load in dynamic web applications by storing objects in memory. It's based on libevent to scale to any size needed, and is specifically optimized to avoid swapping and always use non-blocking I/O.

Options

These programs follow the usual GNU command line syntax. A summary of options is included below.

-s <file>
Unix socket path to listen on (disables network support).
-A
Enable ascii "shutdown" command.
-a <perms>
Permissions (in octal format) for Unix socket created with -s option.
-l <addr>
Listen on <addr>; default to INADDR_ANY. <addr> may be specified as host:port. If you don't specify a port number, the value you specified with -p or -U is used. You may specify multiple addresses separated by comma or by using -l multiple times. This is an important option to consider as there is no other way to secure the installation. Binding to an internal or firewalled network interface is suggested.
-d
Run memcached as a daemon.
-u <username>
Assume the identity of <username> (only when run as root).
-m <num>
Use <num> MB memory max to use for object storage; the default is 64 megabytes.
-c <num>
Use <num> max simultaneous connections; the default is 1024.
-R <num>
This option seeks to prevent client starvation by setting a limit to the number of sequential requests the server will process from an individual client connection. Once a connection has exceeded this value, the server will attempt to process I/O on other connections before handling any further request from this connection. The default value for this option is 20.
-k
Lock down all paged memory. This is a somewhat dangerous option with large caches, so consult the README and memcached homepage for configuration suggestions.
-p <num>
Listen on TCP port <num>, the default is port 11211.
-U <num>
Listen on UDP port <num>, the default is port 11211, 0 is off.
-M
Disable automatic removal of items from the cache when out of memory. Additions will not be possible until adequate space is freed up.
-r
Raise the core file size limit to the maximum allowable.
-f <factor>
Use <factor> as the multiplier for computing the sizes of memory chunks that items are stored in. A lower value may result in less wasted memory depending on the total amount of memory available and the distribution of item sizes. The default is 1.25.
-n <size>
Allocate a minimum of <size> bytes for the item key, value, and flags. The default is 48. If you have a lot of small keys and values, you can get a significant memory efficiency gain with a lower value. If you use a high chunk growth factor (-f option), on the other hand, you may want to increase the size to allow a bigger percentage of your items to fit in the most densely packed (smallest) chunks.
-C
Disable the use of CAS (and reduce the per-item size by 8 bytes).
-h
Show the version of memcached and a summary of options.
-v
Be verbose during the event loop; print out errors and warnings.
-vv
Be even more verbose; same as -v but also print client commands and responses.
-vvv
Be extremely verbose; same of the above and also print internal state transitions.
-i
Print memcached and libevent licenses.
-P <filename>
Print pidfile to <filename>, only used under -d option.
-t <threads>
Number of threads to use to process incoming requests. This option is only meaningful if memcached was compiled with thread support enabled. It is typically not useful to set this higher than the number of CPU cores on the memcached server. Setting a high number (64 or more) of worker threads is not recommended. The default is 4.
-D <char>
Use <char> as the delimiter between key prefixes and IDs. This is used for per-prefix stats reporting. The default is ":" (colon). If this option is specified, stats collection is turned on automatically; if not, then it may be turned on by sending the "stats detail on" command to the server.
-L
Try to use large memory pages (if available). Increasing the memory page size could reduce the number of TLB misses and improve the performance. In order to get large pages from the OS, memcached will allocate the total item-cache in one large chunk. Only available if supported on your OS.
-b <num>
Set the backlog queue limit to <num> connections. The default is 1024.
-B <proto>
Specify the binding protocol to use. By default, the server will autonegotiate client connections. By using this option, you can specify the protocol clients must speak. Possible options are "auto" (the default, autonegotiation behavior), "ascii" and "binary".
-I <size>
Override the default size of each slab page. The default size is 1mb. Default value for this parameter is 1m, minimum is 1k, max is 128m. Adjusting this value changes the item size limit. Beware that this also increases the number of slabs (use -v to view), and the overal memory usage of memcached.
-S
Turn on SASL authentication. This option is only meaningful if memcached was compiled with SASL support enabled.
-F
Disables the "flush_all" command. The cmd_flush counter will increment, but clients will receive an error message and the flush will not occur.
-o <options>
Comma separated list of extended or experimental options. See -h or wiki for up to date list.
-V
print version and exit

License

The memcached daemon is copyright Danga Interactive and is distributed under the BSD license. Note that daemon clients are licensed separately.

See Also

The README file that comes with memcached
http://www.memcached.org

Author

The memcached daemon was written by Anatoly Vorobey <mellon@pobox.com> and Brad Fitzpatrick <brad@danga.com> and the rest of the crew of Danga Interactive http://www.danga.com

Referenced By

libmemcached(3), libmemcached_check_configuration(3), libmemcached_configuration(3), libmemcached_examples(3), memaslap(1), memcached(3), memcached_add(3), memcached_add_by_key(3), memcached_analyze(3), memcached_append(3), memcached_append_by_key(3), memcached_behavior_get(3), memcached_behavior_set(3), memcached_callback_get(3), memcached_callback_set(3), memcached_cas(3), memcached_cas_by_key(3), memcached_clone(3), memcached_create(3), memcached_decrement(3), memcached_decrement_with_initial(3), memcached_delete(3), memcached_delete_by_key(3), memcached_destroy_sasl_auth_data(3), memcached_dump(3), memcached_exist(3), memcached_exist_by_key(3), memcached_fetch(3), memcached_fetch_execute(3), memcached_fetch_result(3), memcached_flush_buffers(3), memcached_free(3), memcached_generate_hash(3), memcached_generate_hash_value(3), memcached_get(3), memcached_get_by_key(3), memcached_get_memory_allocators(3), memcached_get_sasl_callbacks(3), memcached_get_user_data(3), memcached_increment(3), memcached_increment_with_initial(3), memcached_last_error_message(3), memcached_lib_version(3), memcached_mget(3), memcached_mget_by_key(3), memcached_mget_execute(3), memcached_mget_execute_by_key(3), memcached_pool(3), memcached_pool_behavior_get(3), memcached_pool_behavior_set(3), memcached_pool_create(3), memcached_pool_destroy(3), memcached_pool_fetch(3), memcached_pool_pop(3), memcached_pool_push(3), memcached_pool_release(3), memcached_pool_st(3), memcached_prepend(3), memcached_prepend_by_key(3), memcached_quit(3), memcached_replace(3), memcached_replace_by_key(3), memcached_sasl_set_auth_data(3), memcached_server_add(3), memcached_server_count(3), memcached_server_cursor(3), memcached_server_list(3), memcached_server_list_append(3), memcached_server_list_count(3), memcached_server_list_free(3), memcached_server_push(3), memcached_servers_parse(3), memcached_set(3), memcached_set_by_key(3), memcached_set_memory_allocators(3), memcached_set_sasl_callbacks(3), memcached_set_user_data(3), memcached_stat(3), memcached_stat_execute(3), memcached_stat_get_keys(3), memcached_stat_get_value(3), memcached_stat_servername(3), memcached_strerror(3), memcached-tool(1), memcached_touch(3), memcached_touch_by_key(3), memcached_verbosity(3), memcached_version(3), memcapable(1), memcat(1), memcp(1), memdump(1), memerror(1), memexist(1), memflush(1), memparse(1), memping(1), memrm(1), memslap(1), memstat(1), memtouch(1).

April 11, 2005