daily pastebin goal
13%
SHARE
TWEET

Untitled

a guest Sep 22nd, 2018 59 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. #!/usr/bin/env python
  2. # ---------------------------------------------------------
  3.  
  4. import redis
  5.  
  6. POOL = redis.ConnectionPool(host='localhost',port=6379,db=0)
  7.    
  8. # ---------------------------------------------------------
  9.  
  10. def main():
  11.    
  12.    red = redis.Redis(connection_pool=POOL)
  13.    print red.info()['redis_version']
  14.  
  15.    p = red.pipeline(transaction=False)
  16.    for x in range(0,10000):
  17.       red.hmset( "data", {x:x} )
  18.    p.execute()
  19.  
  20.    print red.info()['used_memory']
  21.    for x in range(0,100):
  22.       red.hmget( "data", range(0,10000) )
  23.       print red.info()['used_memory']
  24.    
  25.  
  26. # ---------------------------------------------------------
  27.  
  28. main()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top