Advertisement
Guest User

Untitled

a guest
Mar 17th, 2018
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  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. ~
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement