Server

Running the server: information and statistics, configuration, clients, persistence, replication, backups and memory.

74 commands in KiviDB 1.2.2. Every command.

  • BGREWRITEAOF: Rewrites the append-only file in the background, as the shortest file that rebuilds the dataset.
  • BGSAVE: Writes a snapshot of the dataset to dump.kdb in the background, and replies at once.
  • CLIENT: CLIENT is a container: the work is done by its subcommands, which look at and manage the connections to the server, the one sending them included.
    • CLIENT CACHING: CLIENT CACHING yes makes the next read of an OPTIN connection be remembered; CLIENT CACHING no makes the next read of an OPTOUT one be skipped.
    • CLIENT GETNAME: Returns the name the connection was given with CLIENT SETNAME, or nil when it has none.
    • CLIENT GETREDIR: Returns the ID of the connection this one's client-side caching invalidations go to, as set with REDIRECT in CLIENT TRACKING.
    • CLIENT HELP: Lists the CLIENT subcommands, one line each with its arguments, followed by an indented line saying what it does.
    • CLIENT ID: Returns the connection's ID.
    • CLIENT INFO: Returns this connection's line of CLIENT LIST: its ID, address, name, database, the last command it ran, its user, its protocol (resp=2 or resp=3), the library it reported with CLIENT SETINFO, and it…
    • CLIENT KILL: Closes connections.
    • CLIENT LIST: Returns a line per connection, with Redis's fields: id, addr, laddr, name, age, idle, flags, db, sub, psub, ssub, multi, watch, cmd, user, redir, resp, lib-name, lib-ver and others.
    • CLIENT NO-EVICT: Accepted for compatibility, and changes nothing.
    • CLIENT NO-TOUCH: Accepted for compatibility, and changes nothing.
    • CLIENT PAUSE: Holds clients' commands for timeout milliseconds, or until CLIENT UNPAUSE.
    • CLIENT REPLY: Turns off the server's replies to this connection, to send a stream of commands without reading anything back.
    • CLIENT SETINFO: Records the client library's name, LIB-NAME, or version, LIB-VER, on the connection; CLIENT LIST and CLIENT INFO show them as lib-name and lib-ver.
    • CLIENT SETNAME: Names the connection; the name shows in CLIENT LIST.
    • CLIENT TRACKING: Turns client-side caching on or off for this connection.
    • CLIENT TRACKINGINFO: Returns this connection's client-side caching state, as set with CLIENT TRACKING.
    • CLIENT UNBLOCK: Ends the blocking command another connection is waiting in, such as BLPOP, BLMOVE, BZPOPMIN or XREAD BLOCK, as if its timeout had passed, or with an error.
    • CLIENT UNPAUSE: Ends a CLIENT PAUSE at once, whether it held every command or just writes, and releases the commands it held: each runs, in the order it arrived, and gets its reply.
  • COMMAND: Returns every command, each as an array: its name, its arity (a negative number is a minimum), its flags, the positions of its first and last key and the step between them, and its ACL categories.
    • COMMAND COUNT: Returns the number of top-level commands the server has: those COMMAND describes, without counting subcommands such as CLIENT LIST separately.
    • COMMAND DOCS: Returns the documentation of the commands named, or of every command when none is named: for each, its name and then a map of summary, since, group, complexity, arguments, and history and doc_flags w…
    • COMMAND GETKEYS: Returns the keys a command would use, given its full arguments, without running it.
    • COMMAND GETKEYSANDFLAGS: Returns the keys a command would use, as COMMAND GETKEYS does, each with flags saying how the command uses it.
    • COMMAND HELP: Lists the COMMAND subcommands, one line each with its arguments, followed by an indented line saying what it does: COUNT, LIST, INFO, DOCS, GETKEYS, GETKEYSANDFLAGS and HELP.
    • COMMAND INFO: Returns COMMAND's entry for each command named, or for every command when none is named: nil for a name that is not a command.
    • COMMAND LIST: Returns the names of every command, or of those matching a FILTERBY:
  • CONFIG: Reads and changes the server's settings at runtime.
    • CONFIG GET: Returns the settings whose names match a glob-style pattern, * for all, as name-value pairs.
    • CONFIG HELP: Lists the CONFIG subcommands, one line each with its arguments, followed by an indented line saying what it does: CONFIG GET, CONFIG SET, CONFIG RESETSTAT, CONFIG REWRITE and CONFIG HELP.
    • CONFIG RESETSTAT: Resets the statistics INFO reports, so that they count from now: the number of commands processed and connections received, the network totals, keyspace hits and misses, error counts, and each comman…
    • CONFIG REWRITE: Writes the current settings to the configuration file the server was started with, /etc/kividb/kividb.conf by default.
    • CONFIG SET: Changes settings, all or none of them: a value out of range, a setting that cannot change at runtime, or one named twice makes it an error that names it, and nothing changes.
  • DBSIZE: Returns the number of keys in the current database, the one chosen with SELECT (database 0 unless changed).
  • DEBUG: For tests and tools written for Redis.
    • DEBUG DIGEST-VALUE: For each key, a digest of its value in 40 hexadecimal digits, or 40 zeros for a key that is not there, as in Redis.
    • DEBUG HELP: Lists the DEBUG subcommands, with a line on what each does, as Redis does.
    • DEBUG LOG: Writes message to the server's log, at the WARN level, as DEBUG LOG: <message>.
    • DEBUG OBJECT: Describes the value at key in Redis's form: its encoding, the length of its serialized form and when it was last used.
    • DEBUG PAUSE-CRON: DEBUG PAUSE-CRON 1 pauses the background expiry, of keys and hash fields, and DEBUG PAUSE-CRON 0 resumes it, as Redis's pauses its cron, where that expiry runs.
    • DEBUG POPULATE: Makes count string keys, prefix:0, prefix:1 and on (key:0 and on without a prefix), holding value:0, value:1 and on, cut or padded with zero bytes to size bytes when size is given.
    • DEBUG PROTOCOL: Replies with a value of the RESP type named: string, integer, double, bignum, null, array, set, map, attrib, push, verbatim, true or false.
    • DEBUG SET-ACTIVE-EXPIRE: DEBUG SET-ACTIVE-EXPIRE 0 stops the background expiry of keys and hash fields, and DEBUG SET-ACTIVE-EXPIRE 1 starts it again.
    • DEBUG SET-DISABLE-DENY-SCRIPTS: Accepted, for Redis's test suite, and changes nothing: replies OK for 0 or 1.
    • DEBUG SLEEP: Makes the worker thread that runs it sleep for seconds, which can have a fraction, such as 0.5.
  • ECHO: Returns message, unchanged.
  • FLUSHALL: Deletes every key of every database, then replies.
  • FLUSHDB: Deletes every key of the current database, the one chosen with SELECT, and leaves the other databases as they are.
  • HELLO: Switches the connection to RESP2 or RESP3, and returns the server's details: its name, version, protocol, connection ID, mode, role and modules, as a map under RESP3.
  • INFO: Returns information and statistics about the server, as field:value lines in sections.
  • LASTSAVE: Returns the Unix time of the last snapshot saved, 0 if none.
  • LOLWUT: Returns the KiviDB logo, drawn in block characters, and a last line with the server's version, KiviDB version 1.2.1, bits 64.
  • MEMORY: MEMORY is a container: its subcommands report on the server's memory and on what a key takes.
    • MEMORY DOCTOR: Returns a short report on memory health, in Redis's words.
    • MEMORY HELP: Lists the MEMORY subcommands, one line each with its arguments, followed by an indented line saying what it does: DOCTOR, MALLOC-STATS, PURGE, STATS, USAGE and HELP.
    • MEMORY MALLOC-STATS: Returns the memory allocator's statistics, in Redis.
    • MEMORY PURGE: Asks the allocator to give the free memory it holds back to the system.
    • MEMORY STATS: Returns the server's memory figures as name-value pairs, with the same names as Redis, for tools that read them:
    • MEMORY USAGE: Returns an estimate of the bytes key and its value take; nil if the key does not exist.
  • MONITOR: Streams every command the server runs, from any client, to this connection, each as a line: the time, the database and client address, and the command and its arguments.
  • PSYNC: Sent by a replica to its master to start or resume replication: PSYNC replication-id offset.
  • REPLCONF: Sent by a replica to its master during replication, and not meant for applications.
  • REPLICAOF: Makes the server a replica of the master at host port, or, with NO ONE, a master.
  • ROLE: Returns the server's replication role, with what a client needs to know about it, in fewer bytes than INFO replication.
  • SAVE: Writes a snapshot of the dataset to dump.kdb, in the working directory, before replying.
  • SELECT: Makes database index the connection's current one.
  • SHUTDOWN: Stops the server, by default after saving a snapshot.
  • SLAVEOF: Another name for REPLICAOF, with the same arguments and replies, kept for clients and scripts written before Redis renamed it.
  • SYNC: The original replication handshake: a replica sends it to get a snapshot of the master's data, then every write that follows, with no way to resume after a broken link.
  • TIME: Returns the server's clock: Unix time in seconds, and the microseconds within that second, as two bulk strings.
  • WAIT: Waits until numreplicas replicas have acknowledged every write this connection made before it, or timeout milliseconds pass; 0 waits for ever.
  • WAITAOF: Waits for pending writes to be fsynced to the local append-only file, or until timeout milliseconds pass.