w3resource

Redis Connection: PING

Redis PING Command

Redis PING command is used to check whether a server connection is still alive, or to measure latency.

Here are some common uses and scenarios for the "PING" command:

  • Connection Testing: Checks if the Redis server is reachable and responsive by sending a simple request and expecting a response.
  • Health Monitoring: Monitors the health and status of the Redis server, ensuring it is running and capable of handling requests.
  • Latency Measurement: Measures the round-trip time between the client and the server, helping to assess the network latency.
  • Keep-Alive: Keeps the connection to the Redis server alive during idle periods by sending periodic PING commands.

Syntax:

PING 

Available since

1.0.0.

Return Value

String reply

Return Value Type

String

Example:

redis 127.0.0.1:6379> PING
PONG

Previous: ECHO
Next: QUIT



Become a Patron!

Follow us on Facebook and Twitter for latest update.

It will be nice if you may share this link in any developer community or anywhere else, from where other developers may find this content. Thanks.

https://w3resource.com/redis/redis-ping.php