Memory icon indicating copy to clipboard operation
Memory copied to clipboard

pipeline function not exist

Open dongfengshemaer opened this issue 12 years ago • 6 comments

Hope!!!

dongfengshemaer avatar Feb 03 '13 03:02 dongfengshemaer

What do you mean?

e-oz avatar Feb 03 '13 08:02 e-oz

Look here https://github.com/nrk/predis ,Thanks.

It's very useful when you get 'hget' or 'hset' in 'for' function .

Here is a introduction http://redis.io/topics/benchmarks ,you can search 'pipelining' in the webpage.

$redis = new Predis\Client(array( array('host' => '10.0.0.1', 'port' => 6379), array('host' => '10.0.0.2', 'port' => 6379) ));

$replies = $redis->pipeline(function ($pipe) { for ($i = 0; $i < 1000; $i++) { $pipe->set("key:$i", str_pad($i, 4, '0', 0)); $pipe->get("key:$i"); } });

Pipelining commands to multiple instances of Redis with client-side sharding

Pipelining helps with performances when there is the need to send many commands to a server in one go. Furthermore, pipelining works transparently even on aggregated connections. To achieve this, Predis supports client-side sharding using consistent-hashing on keys while clustered connections are supported natively by the client class.

dongfengshemaer avatar Feb 04 '13 08:02 dongfengshemaer

I'm going to implement it in another repository, dedicated to Redis. Thank you for idea :)

e-oz avatar Feb 05 '13 22:02 e-oz

But please, tell me, why you don't want use Predis and want to use RedisServer? It's not agitation to Predis, I just want to know what is good and what is not enough.

e-oz avatar Feb 05 '13 22:02 e-oz

Only one file. That's Great! I think if one filesize is not too large,we should keep a simple file.Open many tiny files will cost the file handles.

dongfengshemaer avatar Feb 07 '13 08:02 dongfengshemaer

Additional,some of my servers use PHP 5.2(a special extension does not support PHP 5.3),I modify RedisServer code only one line ,the it can run under PHP 5.2.

dongfengshemaer avatar Feb 07 '13 09:02 dongfengshemaer