03:54:05 GMT hi there. is there a way in redis that i can put 4 numbers in redis and then feed a specific math formula into it and pull values that match? 07:49:28 GMT gitgud: can you give an example of what you mean 07:50:31 GMT cbgbt, i feed the db. 4 values in one json. {a: 1, b:2, c:4, d:5} for a dataset. then i say if a+b/20*50000+d < 20 give me those 07:53:25 GMT gitgud: are the equations arbitrary? 07:54:06 GMT cbgbt, what sense do you mean? 07:54:12 GMT the equation will be same each time 07:54:20 GMT well 07:54:23 GMT its sort of like 07:54:29 GMT i'll pass a variable each time 07:54:38 GMT a+b/20*50000+d * (x)< 20 07:54:42 GMT x will be my own variable 07:54:58 GMT But the rest of the equation will always be the same? 07:55:02 GMT yes 07:55:29 GMT Why not rework that equation to be in terms of X, and then solve the other side upon entering data into redis? 07:56:16 GMT I think you could store your data points as a zset where the score is the LHS of that equation, and X is the RHS 07:56:30 GMT Then when you know X, you could do a range query. Does that make sense? 07:57:19 GMT i dont know X beforehand. the X is user inputed 07:57:28 GMT correct 07:57:52 GMT The equation you've given is equivalent to x < 20 / (a+b/20*50000+d), right? 07:58:03 GMT yeah 07:58:35 GMT sigh actually 07:58:38 GMT i should do this this way 07:58:50 GMT im trying to store rectangles in a redis array. and i want to feed it a point 07:59:01 GMT to fetch all rectanges that point encloses :p 07:59:34 GMT And the rectangles and point can be arbitrary, I assume? 07:59:51 GMT the point will be user provided 08:00:02 GMT the rectangles will also be user provided, but by a different user 08:00:21 GMT the rectangle enclosure formally would remain the same, logically 08:00:25 GMT formula* 08:00:43 GMT But you need to be able to answer enclosure for all rectangles 08:01:00 GMT yeah 08:01:31 GMT so say there are 10000 rectangles. thats 2 [lat,long] arrays for 2 corners. and then i feed it a point 08:01:42 GMT and i get say 50 rectangle objects that the point happened to be inside 08:01:55 GMT Yeah, and I presume you want to do better than a linear search for each point query 08:02:03 GMT yeah 08:02:13 GMT but i'd prefer to keep this in memory 08:02:16 GMT no write to disks please 08:02:28 GMT as this data is very prone to updating and vigorous querying 08:03:37 GMT gitgud: Mind you, I haven't solved this problem before, but I think you'll have a little work ahead of you to get redis to do something nonlinear 08:04:00 GMT For example, you could use Bounding Volume Heirarchies to get something a little more logarithmic 08:04:12 GMT But you'd be on the hook for implementing that in a Lua script or a Redis module 08:04:25 GMT https://en.wikipedia.org/wiki/Bounding_volume_hierarchy 08:04:49 GMT ok thanks for the help cbgbt i'll look into it from here 08:05:10 GMT OK. gitgud: keep in mind, if your data set isn't huge, linear search might not be the end of the world. 08:05:38 GMT heh ok. will do 08:05:48 GMT i may use things like quadtree or k-d tree 08:09:21 GMT I've not used those structures for spatial indexing, only nearest-neighbor, but that ought to work :) 11:52:11 GMT Hi! We experience many established connections on our sentinels, and after some time no new connections are possible because "maxclients" is reached. Is there a way to set a client timeout for sentinels? 15:44:41 GMT I'm saving some information on a hash as {'key': 'expiration_date'}. I'm thinking to create a lua script to remove keys where the expiration_date is in the past. What do u guys think? 15:48:46 GMT it will be expensive 15:48:50 GMT and redis will be blocked while you do it 15:49:09 GMT better use a second structure to efficiently manage expiry 15:49:11 GMT like a sorted set 16:02:21 GMT Habbie: yes, sounds much better, is multi expensive? So I could add to the hash and to the sorted set at the same time? 16:02:58 GMT I'm just thinking if I keep both structures, I can check if a key is valid very fast using the hash and for cleanup I can use the sorted set 16:03:38 GMT x-warrior, no that's fine 16:03:50 GMT x-warrior, i do use lua for keeping structures in sync, this is also fine 16:03:55 GMT x-warrior, they're small operations 16:04:11 GMT interesting 16:04:49 GMT all the benefits of multi, but you keep your logic in one place 16:04:55 GMT even if you have apps written in different language talking to your database 16:08:16 GMT After using BITSET, should it be possible to export the bit array using GET? What I get back from GET doesn't look like a clearcut bit array. 16:08:57 GMT after BITSET, your value is still a string 16:09:17 GMT *SETBIT 16:09:34 GMT The \x00 would clearly be unset bits, however there are quite a few ordinal chars in the string value that are not just \x01 or similar. 16:09:38 GMT Habbie: yes, sounds a great plan... I will dig a little bit more in lua + redis 16:09:39 GMT thanks! 16:09:43 GMT I've got a couple of spaces, at signs, etc. 16:10:25 GMT frickenate, a space is 32, which has one bit set 16:10:31 GMT frickenate, @ is 64 16:10:44 GMT ah, I'm dumb. 16:12:05 GMT I was assuming it was returning bit representations based on the \x00's, rather than the bytes. Thanks. 16:12:46 GMT np 16:13:41 GMT confirmed, all non-null-byte values' ordinals are powers of 2. Hurrah! Back to work with me. 16:13:59 GMT :) 18:03:08 GMT Howdy 18:03:21 GMT looks like WHM installs only the php redis extension 18:03:37 GMT so would this be what should be done before hand? 18:03:39 GMT wget http://redis/.../epel-release-6-8.noarch.rpm wget http://remi/.../remi-release-6.rpm untar if needed rpm -Uvh remi-release-*.rpm epel-release-*.rpm yum install -y redis chkconfig -level 2345 redis on vim /etc/redis.conf add lines: maxmemory 256mb maxmemory-policy allkeys-lru And then install php redis on WHM again. 21:26:27 GMT if i'm not using RedisModule_AutoMemory, do I need to free the RedisModuleStrings passed in as args?