00:08:03 GMT I'm currently looking at SSDB for storing a large amount of data. SSDB is a lot like Redis but uses an underlying DB instead of storing everything in RAM. When I told my colleagues this, they suggested I should just use Redis and let Redis swap. Is this actually advised? I know about the VM system that's now deprecated, but I haven't heard of people deliberately using Redis in conjunction with OS swap functionality. 00:13:09 GMT In my case, I don't think performance is as big a consideration as simply being able to store the stuff is. 00:14:21 GMT And what I find appealing about using something about SSDB is that it's explicitly designed to use the hard disk, instead of just falling back on the operating system and otherwise not being designed with hard disks in mind. 05:38:10 GMT ьщктштп 05:38:13 GMT morning 08:55:22 GMT I must write the same data in two database (0 and 2 for example). So, what method will be the best? Use two connection red1= redis.StrictRedis(host='127.0.0.1', port=6379, db=0) and red2= redis.StrictRedis(host='127.0.0.1', port=6379, db=2) and later use it like red1.set(data) + red2.set(data) or use internal command like "select 2" before insert value in next time? 09:02:41 GMT Hmm, is there any way to get `RPOPLPUSH` like functionality for Sorted Set? I'm thinking ZADD/ZREM within a Multi/Exec or maybe even within LUA. 10:05:38 GMT kobzar:doesn't matter if you're not performance-bound. but that sounds like a bad idea anyway 10:06:04 GMT maybe 10:06:05 GMT sev1: not possible with MULTI, but a Lua script will work 10:17:10 GMT we have an existing redis setup where a central master instance accepts writes, while each application server has a local redis instance that's a replication slave to that central master instance. 10:18:07 GMT the master is a SPOF (the slaves allow for stale reads though), which I'd like to mitigate. I'm eyeing redis-sentinel for that purpose, but I'm not sure if it's OK to have a sentinel'd set of (candidate) masters to also replicate to a set of redis instances that cannot become a master instance 10:18:39 GMT can you enlighten me if that is possible? (or tell me that I'm doing it wrong, if that is the case :)) 10:20:51 GMT colo-work: if they're all on the same LAN it should work; the local/slave redis instances would be managed by the sentinels too, but you can prevent their election to master by setting their slave-priority to 0 10:23:08 GMT minus, all instances are on addresses that share a broadcast domain, if that's what is required 10:23:18 GMT yeah 10:24:03 GMT the sentinels should probably go on the application servers, too 10:26:29 GMT my plan is to pair redis instances with sentinel instances 1:1 for each host 10:27:22 GMT yeah, that's fine; it should be an uneven number however 10:27:52 GMT not sure if that's really required though 10:28:09 GMT I know. with our current setup, network partitions are both very unlikely and nigh-catastrophic anyway ;) 10:28:50 GMT heh 10:41:31 GMT minus: right, so a lua script of ZADD and ZREM would be an exact replica of RPOPLPUSH? 10:41:45 GMT I thought eval would block, is that correct? 10:42:27 GMT eval is atomic and blocks, yes 10:42:49 GMT hmm, so it's not exactly like RPOPLPUSH then or am I missing something? 10:44:52 GMT I mean, how does Redis work when it gets `RPOPLPUSH` and a second commend from a different client. Will the first one block? 10:45:27 GMT RPOPLPUSH isn't blocking 10:45:37 GMT it won't do anything if the list is empty 10:46:13 GMT yeah that's what I am thinking. Remaking it with ZADD and ZREM with eval will block 11:06:28 GMT Wishlist: - Docker redis cluster 11:06:30 GMT :) 11:16:38 GMT wishlist: no docker please 11:57:01 GMT Does every single redis command lock or can you run multiple operations in parallel? The reason I ask is because I am considering between RPOPLPUSH and using lua script to replicate that for a sorted set. 11:57:36 GMT Wishlist: - no Docker 12:05:53 GMT Is a Lua script "stop the world" blocking? Is RPOPLPUSH implemented the same way? 12:06:31 GMT I'm guessing since Redis is single threaded, every single operation is "stop the world"? 12:07:12 GMT Hello, My key are expiring before the TTL, it's normal? 12:10:03 GMT No 12:10:40 GMT why this occur? there isn't enough memory? 12:11:20 GMT kobzar, https://pastebin.com/VwWfMkpF 12:38:01 GMT Is Redis single threaded in a way that every command run means no other command can possibly read or change anything at the same time. Do I understand this correctly? 12:40:38 GMT yes 12:41:30 GMT single threaded synchronous. the only thing that does not run in the same thread is saving to disk; that forks though instead of using a thread 12:46:11 GMT kobzar, can you help me please? 12:47:33 GMT "Hello, My key are expiring before the TTL, it's normal?" how are you check it? 12:48:12 GMT i create a simple PHP to get a session, i access them and get a ID 12:48:29 GMT with ID i get info in REDIS about the key 12:48:54 GMT if i don't refresh the PHP page in ~5 minutes the KEY expire in Redis and my session are lost 12:50:20 GMT minus: Alright, so a LUA script itself isn't "heavier" than any other Redis command on e.g list. Just to be clear? 12:50:35 GMT Except the content of it might be heavy, but that's not related. 12:51:22 GMT do you understand kobzar? If you need some config file or other info i can send to you 12:51:30 GMT if you're doing a lot of things in it you will take redis' time 12:51:35 GMT benchmark it, sev666 12:51:57 GMT minus: I am first trying to understand. I think your initial sentence was good. Every command is run synchronous, so it doesn't really matter. 12:52:11 GMT Is this true today? The docs I was reading was old. 12:53:20 GMT I doesn't need your config! You say that you key is missed before the expired time is finish. Yes? 12:53:58 GMT kobzar, yes! 12:55:09 GMT Ok! First - forgot for PHP. Connect to redis with redis-cli (or another client) and make new key with value and expired time by hand. 12:56:09 GMT something like set new_key some_value next add expired time expired mew_key 120 and look the TTL ttl new_key ! 12:56:52 GMT we need find issue place first. This is redis problem or your PHP code. 12:57:24 GMT Ok 12:57:38 GMT set test "Test Session" EX 1440 12:58:11 GMT ttl test ? 12:58:22 GMT EX 1440 set ttl to 1440 12:58:32 GMT ah ok 12:58:33 GMT 127.0.0.1:6379> ttl "test" 12:58:33 GMT (integer) 1368 12:58:56 GMT 127.0.0.1:6379> OBJECT IDLETIME "test" 12:58:56 GMT (integer) 69 12:58:56 GMT 127.0.0.1:6379> ttl "test" 12:58:56 GMT (integer) 1338 12:59:00 GMT sorry 12:59:01 GMT https://pastebin.com/nzEMr75H 12:59:03 GMT so. as we can see all good. try get the data 12:59:27 GMT 127.0.0.1:6379> get test 12:59:27 GMT "Test Session" 12:59:39 GMT Ok, we need wait a some minutes 12:59:47 GMT no problem 13:00:17 GMT paste all commands - i do the same in my test redis for compare result 13:01:02 GMT and check the ttl value from time to time by "ttl test' 13:01:47 GMT Ok 13:01:55 GMT i started a new session in PHP too 13:02:00 GMT to compare expire in both cases 13:06:02 GMT i think problem in PHP 13:06:45 GMT until now none session expired 13:08:20 GMT maybe you use in php another method? for example you set expire value in ms (not in seconds)? As you understand 3600 ms = 3.6 seconds (not 60 seconds) 13:09:09 GMT my php.ini are: session.gc_maxlifetime = 1440 13:10:11 GMT Just look what are you doing. Add new key from you PHP code and check ttl for it in console. 13:10:34 GMT 127.0.0.1:6379> ttl "PHPREDIS_SESSION:vr1k39js3d524rg43e856n8mf7" 13:10:34 GMT (integer) 834 13:10:39 GMT i did this 13:11:26 GMT and i'm waiting the session will be lost 13:15:18 GMT ini_set('session.gc_maxlifetime', 604800); 13:15:18 GMT session_start(); 13:15:23 GMT Do you have something like this in your PHP script ? 13:16:12 GMT no, my script is very simple 13:16:13 GMT https://pastebin.com/nA6Z8PvX 13:18:13 GMT it's very strange, the session isn't lost now ;/ 13:21:38 GMT like you trouble https://github.com/phpredis/phpredis/issues/586 Just add this parameter in your PHP like this https://github.com/phpredis/phpredis/issues/224 13:24:22 GMT Quick manual https://istvan.xyz/php-sessions-in-redis.html 13:25:39 GMT kobzar, i'm trying simulate the problem now 13:39:41 GMT hi I have use case need help how i can i solve with redis 13:45:44 GMT minus: Thanks for the help! 17:14:51 GMT Hi, i have this warning in the logs (which we have fixed), "The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128." 17:15:36 GMT i was trying to understand what the impact of this might be.. we have a server where we get a very occasional "AbortError" from a nodejs redis library.. it seems to be happening more offten as we get more load 17:16:16 GMT like 1 out of 100000 type of requests. could the low somaxconn setting be a reason for the "abortError" message? 17:16:44 GMT we increased to 1024 today and will monitor for the next week.. if we don't see the error again in that time, I'm pretty sure that was it.. 17:17:51 GMT only if you're spawning a /lot/ of new connections to redis 17:18:44 GMT minus, the weird thing is that my connected_clients=237 17:18:52 GMT which is past the 128 limit in somaxconn 17:19:12 GMT that's not what the backlog is for 17:19:12 GMT so i guess I'm confused by that as well.. is there some relation between connected_clients and the backlog? 17:19:56 GMT is there any relation between the 2? 17:20:06 GMT the backlog setting controls how many new connections may be outstanding, i.e how many connections may be waiting for being accept()ed 17:20:13 GMT no relation 17:20:32 GMT the total amount of connections is limited by the file descriptor limit 17:26:02 GMT ahh got it.. what example scenerio would cause the backlog limit to be hit? 17:26:35 GMT i was trying to simulate that to see if I get teh same AbortError in my nodejs log 17:26:46 GMT lots of new connections. high CPU usage probably makes it easier to hit that 17:27:25 GMT ahh.. cool.. very helpful, thanks! 17:39:40 GMT minus, is there a way to monitor the backlog size at any point in time? I would love to feed it into my monitoring system to keep an eye on 17:39:51 GMT like the current queue size i mean 17:40:26 GMT with some system tools probably 17:40:34 GMT `ss` might have some info on it 17:41:28 GMT great, i'll check that out 17:44:09 GMT had no idea netstat was deprecated in favor of ss.. 17:56:00 GMT minus,ss -lt Send-Q seems to be it. itneresting read on it here: inhttps://stackoverflow.com/questions/36466744/use-of-recv-q-and-send-q 17:59:12 GMT now you know ;) 19:43:24 GMT so… i am hyper confused, i am trying: ./redis-trib.rb check localhost:6379 and getting data back in the form of: M: f857a8600146b53e0a5154a6410a17b8acccdc70 localhost:6379 19:43:24 GMT slots: (0 slots) master 19:43:50 GMT but when i try and do redis-trib.rb create 1 —replicas localhost:6379 i get [ERR] Sorry, can't connect to node localhost:6379 19:43:57 GMT protected-mode is set to no