This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python | |
| import time | |
| import rediscluster | |
| CHANNEL = 'chat' | |
| COUNT = 1000 | |
| SLEEP = 0.01 | |
| startup_nodes = [{'host':'127.0.0.1', 'port': 7000}] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import rediscluster | |
| import threading | |
| import time | |
| import random | |
| startup_nodes = [ | |
| {'host':'127.0.0.1', 'port': 7000}, | |
| {'host':'127.0.0.1', 'port': 7001}, | |
| {'host':'127.0.0.1', 'port': 7002}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/rediscluster/pipeline.py b/rediscluster/pipeline.py | |
| index 2106e70..a13e867 100644 | |
| --- a/rediscluster/pipeline.py | |
| +++ b/rediscluster/pipeline.py | |
| @@ -175,6 +175,8 @@ class StrictClusterPipeline(StrictRedisCluster): | |
| if i in ask_retry: | |
| track_cmds[node_name].append(None) | |
| cmds.append((['ASKING'], {})) | |
| + print "ASKING ... threaded" | |
| + |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from rediscluster import RedisCluster | |
| startup_nodes = [{"host": "127.0.0.1", "port": 7000}] | |
| r = RedisCluster(startup_nodes=startup_nodes, max_connections=32, decode_responses=True) | |
| for i in xrange(1000000): | |
| d = str(i) | |
| pipe = r.pipeline(transaction=False) | |
| pipe.set(d, d) | |
| pipe.incrby(d, 1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from rediscluster import RedisCluster | |
| startup_nodes = [{"host": "127.0.0.1", "port": 7000}] | |
| r = RedisCluster(startup_nodes=startup_nodes, max_connections=32, decode_responses=True) | |
| for i in xrange(1000000): | |
| d = str(i) | |
| r.set(d, d) | |
| res = r.get(d) | |
| if res != d: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from rediscluster import RedisCluster | |
| startup_nodes = [{"host": "127.0.0.1", "port": 7000}] | |
| r = RedisCluster(startup_nodes=startup_nodes, max_connections=32, decode_responses=True) | |
| for i in xrange(1000000): | |
| d = str(i) | |
| r.set(d, d) | |
| r.incrby(d, 1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from rediscluster import RedisCluster | |
| startup_nodes = [{"host": "127.0.0.1", "port": 7000}] | |
| r = RedisCluster(startup_nodes=startup_nodes, max_connections=32, decode_responses=True) | |
| N = 1000000 | |
| p = 0 | |
| pdiff = 1 | |
| progress = 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import rediscluster | |
| import threading | |
| import time | |
| import random | |
| startup_nodes = [ | |
| {'host':'127.0.0.1', 'port': 7000}, | |
| {'host':'127.0.0.1', 'port': 7001}, | |
| {'host':'127.0.0.1', 'port': 7002}, | |
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| import redis | |
| import rediscluster | |
| import argparse | |
| def main(srcs, dsts, verbose=False): | |
| srcs = [redis.StrictRedis(**host) for host in srcs] | |
| if len(dsts) > 1: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ redis-trib check :7000 | |
| Connecting to node :7000: OK | |
| Connecting to node 172.31.14.27:7001: OK | |
| Connecting to node 172.31.12.228:7001: [ERR] Sorry, can't connect to node 172.31.12.228:7001 | |
| OK | |
| Connecting to node 172.31.12.228:7002: [ERR] Sorry, can't connect to node 172.31.12.228:7002 | |
| OK | |
| Connecting to node 172.31.12.228:7000: [ERR] Sorry, can't connect to node 172.31.12.228:7000 | |
| OK | |
| Connecting to node 172.31.14.27:7000: OK |