This is an old revision of the document!


LSMCD Commands

In order to connect to and interact with LSMCD, you can use telnet to connect to a one of the IP addresses and port numbers set in Cached.Addr. For example, with the default settings, you would connect using the following command:

telnet 127.0.0.1 11211

The following is a list of LSMCD commands useable in telnet, each with a brief description. For more information, see each command's page.

get - Read the value tied to the user-provided key.

bget - Read the binary value tied to the user-provided key.

gets - Read the value tied to the user-provided key and its cas token (to be used with the cas command).

add - Add a key/value pair only if a pair does not already exist for the user-provided key.

set - Store a key/value pair. If a pair already exists for the user-provided key, overwrites it.

replace - Store a key/value pair, but only if it already exists.

append - Add data to an existing key after existing data.

prepend - Add data to an existing key before existing data.

cas - Check-and-Set an item; store data only if no one else has updated since the last fetch, determined with the cas token from the gets command.

Increment numerical key’s value by the given number if the key/value pair exists.

Decrement numerical key’s value by the given number if the key/value pair exists.

syntax:

decr <key> <value> [noreply]

example:

decr mykey 3

2

output notes:

  • 3 → value to decrement by.
  • In this example, if “mykey” had a value of “5”, after running decr, its value would be “2”.

Delete an existing key/value pair.

syntax:

delete <key> [<time>] [noreply]

example:

delete mykey

DELETED

Update the expiration time for a key/value pair without fetching it.

syntax:

touch <key> <TTL> [noreply]

example:

touch mykey 1200

TOUCHED

output notes:

  • 1200 → new TTL in seconds

Print or reset general statistics

syntax:

stats [reset]

example:

stats

STAT pid 16825
STAT version 1.0.0
STAT pointer_size 64
STAT rusage_user 0.300000
STAT rusage_system 0.520000
STAT cmd_get 10
STAT cmd_set 11
STAT cmd_flush 2
STAT cmd_touch 2
STAT get_hits 8
STAT get_misses 2
STAT delete_misses 0
STAT delete_hits 1
STAT incr_misses 0
STAT incr_hits 1
STAT decr_misses 1
STAT decr_hits 1
STAT cas_misses 0
STAT cas_hits 1
STAT cas_badval 0
STAT touch_hits 2
STAT touch_misses 0
STAT auth_cmds 0
STAT auth_errors 0
END

example:

stats reset

RESET

Delete all key/value pairs immediately.

syntax:

flush_all [<time>] [noreply]

example:

flush_all

OK

Print server version.

syntax:

version

example:

version

VERSION 1.0.0

Terminate telnet session.

syntax:

quit

example:

quit

Connection closed by foreign host.

Increase log version.

syntax:

verbosity <level> [noreply]

example:

verbosity 1

OK
  • Admin
  • Last modified: 2016/04/07 14:08
  • by Rob Holda