arpit7275 / redis

Automatically exported from code.google.com/p/redis
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

[FEATURE REQUEST] Add "server_time" to INFO. #599

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Idea:
Have the INFO command include "server_time" which is the current unix time of 
the redis server.

Reason:
This would allow redis to be used as a network time server.

Use Case:
This would be useful for a group of redis clients that do time based 
calculations. A example is client side expiration calculation on ZSET elements.

The way people must do this now is to use software to keep system clocks 
synchronized. Using "server_time" would be less efficient but negligible.

The advantage of this is the KISS principle. Relying on redis to tell you the 
time is simpler than relying daemons to keep system times synchronized. :)

Original issue reported on code.google.com by seth.bu...@gmail.com on 29 Jun 2011 at 6:44

GoogleCodeExporter commented 8 years ago
I'm not against having the time as part of INFO.

I do think your reasons for having it are not very good. Since you probably 
also want your Redis server to be close to actual time, you still need to 
install NTP on any server running Redis (or run ntpupdate every once in a 
while). Never mind other database servers, etc. On Debian, Ubuntu, etc., they 
make it very easy: "apt-get install ntp".

Original comment by josiah.c...@gmail.com on 29 Jun 2011 at 9:12

GoogleCodeExporter commented 8 years ago
I would like the server time in INFO as well, but would not use it as a time 
server ;-). I could see something like this (albeit with microsecond 
resolution) be useful for clients to bail out if the difference is too large 
(basically checking if the time daemons are doing their work).

Original comment by pcnoordh...@gmail.com on 6 Jul 2011 at 11:25