Server

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

79 commands in KiviDB 1.1.2. Every command.

  • BACKUP: Takes a consistent backup of the dataset while the server keeps serving: a snapshot as of the start, then the writes that follow, up to the moment it is sealed.
    • BACKUP ABORT: Cancels a backup that has not been sealed; its state becomes failed, with the error aborted.
    • BACKUP CLEANUP: Removes the files of a sealed or failed backup.
    • BACKUP HELP: Lists the BACKUP subcommands and what each does.
    • BACKUP LIST: Returns the paths of the backup's files that are complete and safe to copy: the snapshot; once sealed, also the writes and the manifest.
    • BACKUP SEAL: Ends the backup: it now holds everything up to this moment, and its manifest is written.
    • BACKUP START: Starts a backup: writes a snapshot of the dataset as of now into the backup directory, then collects the writes that follow.
    • BACKUP STATUS: Returns the backup's state, its error if it failed, and its start and end times.
  • 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: Inspects and manages client connections.
    • 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 connection's name, or nil.
    • CLIENT GETREDIR: Returns the connection this one sends its invalidations to; -1 if tracking is off or it does not redirect.
    • CLIENT HELP: Lists the CLIENT subcommands and what each does.
    • CLIENT ID: Returns the connection's ID, unique for the server's lifetime.
    • CLIENT INFO: Returns this connection's line of CLIENT LIST.
    • 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: Marks the connection, ON, as one that is not closed to free memory, or, OFF, as one that may be.
    • CLIENT NO-TOUCH: Accepted.
    • CLIENT PAUSE: Holds clients' commands for timeout milliseconds, or until CLIENT UNPAUSE.
    • CLIENT REPLY: OFF stops the replies to this connection's commands until ON; SKIP drops the reply to the next command alone.
    • CLIENT SETINFO: Records the client library's name, LIB-NAME, or version, LIB-VER, on the connection; CLIENT LIST shows 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 tracking state: its flags (off, on, bcast, optin, optout, noloop), the connection it redirects to, and its prefixes.
    • CLIENT UNBLOCK: Accepted for compatibility, and replies 0: KiviDB 1.1 does not unblock a client waiting in a blocking command this way.
    • CLIENT UNPAUSE: Ends a CLIENT PAUSE at once, releasing the clients it held.
  • 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 commands.
    • COMMAND DOCS: Returns an empty array in KiviDB 1.1, so that clients that ask, such as redis-cli, still connect.
    • COMMAND GETKEYS: Returns the keys a command would use, given its arguments.
    • COMMAND GETKEYSANDFLAGS: Returns the keys a command would use, each with how it uses it.
    • COMMAND HELP: Lists the COMMAND subcommands and what each does.
    • COMMAND INFO: COMMAND's entries for the commands named, nil for a name that is not a command, or for every command.
    • COMMAND LIST: Returns the names of every command, or of those matching a FILTERBY: PATTERN pattern, ACLCAT category, or MODULE module (always empty).
  • 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 and what each does.
    • CONFIG RESETSTAT: Resets the statistics INFO reports: commands' counts and times, error counts, and connection and network totals.
    • CONFIG REWRITE: Writes the current settings to the configuration file the server was started with, /etc/kividb/kividb.conf by default, creating it and its directory if needed.
    • 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.
  • DEBUG: Accepted for compatibility with Redis tools.
  • ECHO: Returns message.
  • FAILOVER: Refused.
  • FLUSHALL: Deletes every key of every database.
  • FLUSHDB: Deletes every key of the current database.
  • 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 a small drawing and the server's version.
  • MEMORY: Reports on memory use.
    • MEMORY DOCTOR: Returns a short report on memory health, in Redis's words.
    • MEMORY HELP: Lists the MEMORY subcommands and what each does.
    • MEMORY MALLOC-STATS: Returns the allocator's statistics.
    • MEMORY PURGE: Asks the allocator to give free memory back to the system.
    • MEMORY STATS: Returns memory figures as name-value pairs: used_memory, used_memory_rss, used_memory_peak and others.
    • MEMORY USAGE: Returns an estimate of the bytes key and its value take; nil if the key does not exist.
  • MODULE: KiviDB does not load modules.
    • MODULE HELP: Lists the MODULE subcommands and what each does.
    • MODULE LIST: Names the built-in families clients look for, with the versions of Redis 8.10's, and an empty path, as Redis lists its built-in vectorset: search, ReJSON, timeseries and vectorset.
    • MODULE LOAD: Refused: KiviDB does not load modules, since Redis's module interface, a C library loaded into the server, does not fit KiviDB's design.
    • MODULE LOADEX: Refused, as MODULE LOAD is.
    • MODULE UNLOAD: Refused, as MODULE LOAD is.
  • 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 between a master and its replicas during replication: the replica's port, its acknowledged offset, and its capabilities.
  • 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: master with its offset and replicas, or slave with its master and state.
  • 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.
  • SYNC: The original replication handshake: a replica sends it to get a snapshot, then every write.
  • TIME: Returns the server's clock: Unix 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 until every write this connection made before it is in the local AOF and fsynced (numlocal), and in numreplicas replicas' AOFs, or timeout milliseconds pass.