Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ocal redis= require 'redis'
- local client = redis:connect()
- function repeats(s, n) return n > 0 and s .. repeats(s, n-1) or "" end
- local contacts = repeats("5:{label:fdsafdsafsad dasfdsadfas a asd dsfa },", 100)
- messages ={}
- for i=1, 100 do
- table.insert(messages,"{from_id: 55555 content:dasfdsadfas a asd dsfa },")
- end
- local user = '{id:1, email: email.com.br, password: password, contacts:{'..contacts ..'}}'
- client:flushall();
- local memory = client:info('memory')['memory']['used_memory_human']
- print ('used memory', memory)
- for i=1, 10000 do
- client:set('user:'..i, 'abc')
- client:lpush('user:'..i ..'messages', unpack(messages))
- end
- local memory = client:info('memory')['memory']['used_memory_human']
- print ('used memory', memory)
- ~
- ~
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement