HfogDocsv1.0.0

Redis and Memcached

Browse your account's Redis keys by prefix in DB Studio, see and edit strings, hashes, lists, sets, sorted sets and streams, set a time to live, run commands in the console, and look after a Memcached cache.

DB Studio opens the Redis and Memcached caches of your hosting account. Both are reached through the cache's own socket as your account: nobody else's keys can be seen, and no password is typed.

Where: DB Studio › redis or memcached in the tree

Both are listed once they are switched on for your account in the Control Panel.

Redis

Redis numbers its databases 0 to 15. The Structure tab lists the ones that hold keys; open one to see its keys.

Tab What it does
Browse the keys, grouped by prefix
Console runs Redis commands
Insert makes a new key
Operations Empty this database
Status (on the store) version, memory, clients, hits and misses

Browse keys

Keys are grouped by the part before each :, so session:ab12 and session:cd34 are under session:. Click a prefix to go into it; the path above the list goes back.

  • Search keys: type a prefix (session:) or a pattern (user:*:cart) and click Search.
  • Each key shows its Type, Size and Time to live.
  • A database with very many keys is read in parts: Load more reads on. The counts are then of the keys seen so far.
  • Tick keys and use With selected: to delete several.

Note: keys are always listed with SCAN, which reads a little at a time, so browsing a big cache doesn't stall the sites that use it.

See and edit a key

Click a key (or Edit) to open it:

Type What you can do
string change the value
hash add, change and remove fields
list add, change and remove items
set add and remove members
sorted set add members with a Score, change the score, remove
stream see the entries, add one (fields as field=value, one per line), remove

Time to live (seconds) sets when the key expires; None keeps it until it is deleted. Rename gives the key another name, and Delete key removes it.

A value that is not text is shown as hex and can't be edited here; a very long one shows its start only.

The console

Type a command and click Run, for example SCAN 0 MATCH user:* COUNT 100. The console runs commands that read and change keys. These are not run:

  • KEYS (use SCAN), and commands that wait, such as BLPOP, SUBSCRIBE and MONITOR
  • scripts (EVAL), and the server's own commands (CONFIG, FLUSHALL, SHUTDOWN, SELECT)

The database the console works in is the one that is open. Commands that change something are written to the activity log.

Memcached

Tab What it does
Status version, items, memory, hits and misses
Browse Look up an item by its exact key; Keys lists a sample of the keys
Insert Store an item: a key, a value and a time to live
Operations Empty the cache

Memcached is made to answer for one exact key, not to be browsed. The Keys list is a sample from the server's own list: an item just stored can take a moment to show, and some servers can't list keys at all. An item's value can be changed or the item deleted once it is open.

A key is up to 250 characters, without spaces. A value up to 1 MB can be edited here.