MEMCACHED(1)

๐Ÿ“ฆ
version 1.6.45 ยท 2 versions
, in alpine 3.23, alpine 3.24, arch rolling, debian trixie, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu questing, ubuntu resolute, ubuntu stonking

๐Ÿ’– MEMCACHED ๐Ÿ’–

okay bestie, buckle up, we're reading the MEMCACHED(1) page together and honestly? it's giving infrastructure icon. This is the manual for memcached, and it lives in the General Commands Manual section, which is the fancy way of saying "yes it's a command, yes it's a big deal." โœจ

๐ŸŒธ NAME ๐ŸŒธ

memcached โ€” a high-performance memory object caching system. that's it, that's the whole vibe. ๐Ÿ’…


๐Ÿฆ‹ SYNOPSIS ๐Ÿฆ‹

memcached [options]

โœจ DESCRIPTION โœจ

so like, this page is the brief little rundown of the memcached memory object caching daemon. consider it the trailer, not the whole movie. ๐ŸŽฌ

memcached is a flexible memory object caching daemon โ€” it was literally designed to take load off your database in dynamic web apps by, you guessed it, storing objects in memory instead. it's based on libevent so it can scale to whatever size you need, no cap. and the way it's specifically optimized to avoid swapping and always use non-blocking I/O? obsessed. ๐Ÿ”ฅ


๐ŸŽ€ OPTIONS ๐ŸŽ€

these programs follow the usual GNU command line syntax, so nothing chaotic there. here's the full rundown, and yes, we're doing all of them, no skipping. ๐Ÿ’–

  • -s, --unix-socket=<file> โ€” unix socket path to listen on. heads up: this disables network support, so it's giving "we only talk locally." ๐Ÿ™ˆ
  • -A, --enable-shutdown โ€” enables the ascii "shutdown" command.
  • -a, --unix-mask=<perms> โ€” the permissions (in octal format, bestie, octal) for the Unix socket created with the -s option.
  • -l, --listen=<addr> โ€” listen on <addr>; defaults to INADDR_ANY. <addr> can be given as host:port. if you don't specify a port number, the value you set with -p or -U gets used instead. you can also specify multiple addresses separated by commas, or just use -l multiple times. this is an important option to think about, because there is literally no other way to secure the installation. binding to an internal or firewalled network interface is suggested. ๐Ÿ‘‘
  • -d, --daemon โ€” run memcached as a daemon.
  • -u, --user=<username> โ€” assume the identity of <username> (only when run as root).
  • -m, --memory-limit=<num> โ€” use <num> MB memory max for object storage; the default is 64 megabytes.
  • -c, --conn-limit=<num> โ€” use <num> max simultaneous connections; the default is 1024.
  • -R, --max-reqs-per-event=<num> โ€” this one is here to prevent client starvation by capping how many sequential requests the server will process from a single client connection. once a connection goes past this value, the server will try to process I/O on other connections before handling any further request from this one. the default value is 20.
  • -k, --lock-memory โ€” lock down all paged memory. โš ๏ธ ngl, this is a somewhat dangerous option with large caches, so go consult the README and the memcached homepage for configuration suggestions before you get bold.
  • -p, --port=<num> โ€” listen on TCP port <num>, the default is port 11211. 0 means off.
  • -U, --udp-port=<num> โ€” listen on UDP port <num>, the default is port 0, which is off.
  • -M, --disable-evictions โ€” disable automatic removal of items from the cache when it's out of memory. heads up: additions will not be possible until adequate space is freed up. ๐Ÿ’€
  • -r, --enable-coredumps โ€” raise the core file size limit to the maximum allowable.
  • -f, --slab-growth-factor=<factor> โ€” use <factor> as the multiplier for computing the sizes of memory chunks that items get 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, --slab-min-size=<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, a lower value can get you a significant memory efficiency gain. but if you use a high chunk growth factor (the -f option), you might instead want to increase the size so a bigger percentage of your items fit in the most densely packed (smallest) chunks.
  • -C, --disable-cas โ€” disable the use of CAS (and reduce the per-item size by 8 bytes).
  • -h, --help โ€” show the version of memcached and a summary of options.
  • -v, --verbose โ€” be verbose during the event loop; print out errors and warnings.
  • -vv โ€” be even more verbose; same as -v but also prints client commands and responses.
  • -vvv โ€” be extremely verbose; same as the above and also prints internal state transitions. this is the "main character" level of logging. ๐ŸŒˆ
  • -i, --license โ€” print memcached and libevent licenses.
  • -P, --pidfile=<filename> โ€” print pidfile to <filename>, only used under the -d option.
  • -t, --threads=<threads> โ€” number of threads to use to process incoming requests. this option is only meaningful if memcached was compiled with thread support enabled. it's 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, --enable-largepages โ€” try to use large memory pages (if available). increasing the memory page size could reduce the number of TLB misses and improve 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, --listen-backlog=<num> โ€” set the backlog queue limit to <num> connections. the default is 1024.
  • -B, --protocol=<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, --max-item-size=<size> โ€” adjusting this value changes the item size limit. the default value for this parameter is 1m, minimum is 1k, max is 1G (1024 * 1024 * 1024).
  • -S, --enable-sasl โ€” turn on SASL authentication. this option is only meaningful if memcached was compiled with SASL support enabled.
  • -F, --disable-flush-all โ€” disables the "flush_all" command. the cmd_flush counter will increment, but clients will receive an error message and the flush will not occur.
  • -X, --disable-dumping โ€” disables the "stats cachedump" and "lru_crawler metadump" commands.
  • -o, --extended=<options> โ€” comma separated list of extended or experimental options. see -h or the wiki for the up-to-date list. ๐Ÿงš
  • -V, --version โ€” print version and exit.

๐Ÿ’œ LICENSE ๐Ÿ’œ

the memcached daemon is copyright Danga Interactive and is distributed under the BSD license. important lil note: daemon clients are licensed separately, so don't go assuming they're bundled together. ๐Ÿ˜Œ


๐Ÿ“ SEE ALSO ๐Ÿ“

โญ 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 https://www.danga.com โ€” legends, fr fr. ๐Ÿ‘‘


and that's a wrap, bestie!! ๐ŸŽ‰ this page is dated April 11, 2005, and it's part of the General Commands Manual for memcached. yes, it's old, yes it's still iconic, and no, we don't gatekeep it. mwah ๐Ÿ’…๐Ÿ’–โœจ