Redis Server

Redis Server commands are used to manage Redis Server. There are different server commands which can be used to fetch server information, statistics and other characteristics of server.

Example

Let's take an example to see how to get all statistics and information about the server.

Redis Publish Server 1

Redis Server Commands

Following is a list of some server commands used in Redis database:

IndexCommandDescription
1BGREWRITEAOFThis command is used to asynchronously rewrite the append-only file.
2BGSAVEThis command is used to asynchronously save the dataset to the disk.
3CLIENT KILL [ip:port] [ID client-id]This command is used to kill the connection of a client.
4CLIENT LISTThis command is used to get the list of client connections to the server.
5CLIENT GETNAMEThis command is used to get the name of the current connection.
6CLIENT PAUSE timeoutThis command is used to stop processing commands from the clients for a specified time.
7CLIENT SETNAME connection-nameThis command is used to set the current connection name.
8CLUSTER SLOTSThis command is used to get an array of Cluster slot to node mappings.
9COMMANDThis command is used to get an array of Redis command details.
10COMMAND COUNTThis command is used to get total number of Redis commands.
11COMMAND GETKEYSThis command is used to extract the keys given a full Redis command.
12BGSAVEThis command is used to asynchronously save the dataset to the disk.
13COMMAND INFO command-name [command-name ...]This command is used to get an array of specific Redis command details.
14CONFIG GET parameterThis command is used to get the value of a configuration parameter.
15CONFIG REWRITEThis command is used to rewrite the configuration file with the in-memory configuration.
16CONFIG SET parameter valueThis command is used to get a configuration parameter to the given value.
17CONFIG RESETSTATThis command is used to reset the stats returned by INFO.
18DBSIZEThis command is used to return the number of keys in the selected database.
19DEBUG OBJECT keyThis command is used to get debugging information about a key.
20DEBUG SEGFAULTThis command is used to make the server crash.
21FLUSHALLThis command is used to remove all the keys from all databases.
22FLUSHDBThis command is used to remove all the keys from the current database.
23INFO [section]This command is used to get information and statistics about the server.
24LASTSAVEThis command is used to retrieve the UNIX time stamp of the last successful save to the disk.
25MONITORThis command is used to listen for all the requests received by the server in real time.
26ROLEThis command is used to return the role of the instance in the context of replication.
27SAVEThis command is used to synchronously saves the dataset to the disk.
28SHUTDOWN [NOSAVE] [SAVE]This command is used to synchronously saves the dataset to the disk and then shuts down the server .
29SLAVEOF host portThis command is used to make the server a slave of another instance, or promotes it as a master .
30SLOWLOG subcommand [argument]This command is used to manage the Redis slow queries log.
31SYNCThis command is used for replication.
32TIMEThis command is used to return the current server time.





Latest Courses