Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- # ---------------------------------------------------------
- import redis
- POOL = redis.ConnectionPool(host='localhost',port=6379,db=0)
- # ---------------------------------------------------------
- def main():
- red = redis.Redis(connection_pool=POOL)
- print red.info()['redis_version']
- p = red.pipeline(transaction=False)
- for x in range(0,10000):
- red.hmset( "data", {x:x} )
- p.execute()
- print red.info()['used_memory']
- for x in range(0,100):
- red.hmget( "data", range(0,10000) )
- print red.info()['used_memory']
- # ---------------------------------------------------------
- main()
Add Comment
Please, Sign In to add comment