daily pastebin goal
15%
SHARE
TWEET

Untitled

a guest Mar 17th, 2018 81 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ocal redis=  require 'redis'
  2.  
  3. local client = redis:connect()
  4. function repeats(s, n) return n > 0 and s .. repeats(s, n-1) or "" end
  5. local contacts = repeats("5:{label:fdsafdsafsad dasfdsadfas a  asd dsfa },", 100)
  6. messages ={}
  7. for i=1, 100 do
  8.   table.insert(messages,"{from_id: 55555 content:dasfdsadfas a  asd dsfa },")
  9. end
  10. local user = '{id:1, email: email.com.br, password: password, contacts:{'..contacts ..'}}'
  11. client:flushall();
  12. local memory = client:info('memory')['memory']['used_memory_human']
  13. print ('used memory', memory)
  14.  
  15. for i=1, 10000 do
  16.   client:set('user:'..i, 'abc')
  17.   client:lpush('user:'..i ..'messages', unpack(messages))
  18. end
  19.  
  20. local memory = client:info('memory')['memory']['used_memory_human']
  21. print ('used memory', memory)
  22. ~                                                                                                                                            
  23. ~
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