My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
SetCommand  
Updated Dec 21, 2010 by anti...@gmail.com

We moved to Redis.io!

Redis home moved to http://redis.io, please visit our new home.

Comment by gwebmast...@yahoo.com, Dec 25, 2009

It would be nice if an expire could be passed with set. This would reduce protocol overheard drastically.

Comment by JustinPincar, Jan 21, 2010

I second the expire being passed with set feature request.

Comment by project member anti...@gmail.com, Jan 21, 2010

Yes the optional EXPIRE argument is useful. Btw for Redis Git there is a solution:

MULTI
SET ...
EXPIRE ...
EXEC
Comment by brampton, Mar 25, 2010

I benchmarked antirez solution as I came up with it myself.

With a server with "appendfsync always", and a simple PHP script using the Predis library.

SET 563.44 per second
EXPIRE 557.85 per second
SET, EXPIRE 279.96 per second
MULTI, SET, EXPIRE, EXEC 125.48 per second

I get similar results if I change the fsync options.

I suspect the transaction approach is slower because it has additional overheads, for example, maintaining a transaction log. So I would also like set to have a expire argument.

Comment by project member damian.j...@gmail.com, Jul 6, 2010

@brampton, did you try with pipelining? I get these results using the Ruby client:

                                          user     system      total        real
SET                                   0.360000   0.230000   0.590000 (  1.330222)
EXPIRE                                0.360000   0.240000   0.600000 (  1.445814)
SET, EXPIRE                           0.720000   0.470000   1.190000 (  2.698275)
SET, EXPIRE (pipelined)               0.580000   0.240000   0.820000 (  1.763171)
MULTI, SET, EXPIRE, EXEC              1.400000   0.930000   2.330000 (  5.437802)
MULTI, SET, EXPIRE, EXEC (pipelined)  0.880000   0.260000   1.140000 (  2.270239)

Sign in to add a comment
Powered by Google Project Hosting