Memcached

Page content

Install in Ubuntu

apt install -y memcached

Configuration

The configuration file is /etc/memcached.conf. There are comment of each options in the default config file.

-d
-m 256
-p 11211
-u memcache
-l 0.0.0.0
-c 1000
-t 2
-b 500
-R 100
-C
  • -d: Run memcached as a daemon.
  • -m: Occupied memory by Memcached in unit of MB.
  • -p: Connection port.
  • -u: User name running Memcached.
  • -l: Listen IP
  • -c: the number of simultaneous incoming connections.
  • -t: Number of threads to use to process incoming requests.
  • -b: Set the backlog queue limit.
  • -R: Sets the maximum number of requests per event process.
  • -C: Disable the use of compare and swap (CAS) operations.

Protocol

It uses TCP for its own protocol

https://github.com/memcached/memcached/blob/master/doc/protocol.txt

Set vaule

One line checker

echo stats | nc {{ your_memcached_server}} 11211
echo stats | nc memcached.mydomain.com 11211

View informations

  • curr_items 6000: 6,000 items are srotred in this instance.
  • bytes: Current number of bytes used by this server to store items.