FAQ Database Discussion Community


Default Redis behaviour on graceful shutdown

linux,database,redis
What is the default behaviour of Redis when a graceful shutdown is committed? Let's say there are a bunch of keys in Redis. Then due to maintenance needs, the machine needs to be soft rebooted. All services are gracefully killed and the machine boots again. Are the keys still available?...

Connecting to a remote Azure Redis Cache using Redis CLI

.net,windows,azure,redis,stackexchange.redis
I'm trying to use redis-cli to connect to my Redis cache hosted in MS Azure. I created a shortcut to the executable in Windows, passing through the hostname port and pw: "C:\Program Files\Redis\redis-cli.exe" -h myredis.redis.cache.windows.net -p 6380 -a "myaccesskey" But it just hangs there. P.S the connecting string is valid,...

Where is the correct place to store ConnectionMultiplexer in stackexchange redis

c#,asp.net-mvc,redis,stackexchange.redis,stackexchange
Is there a potential issue with storing it as a static variable in my utilities and accessing it anywhere or should using statements be used? I'm assuming the latter, much like a data context but if it's more efficient to use the initial, since I want the connection to pretty...

node.js redis and how to use promise when using a module

javascript,node.js,redis,promise,q
I have an Express route like this in an node server (file is required): var redis = require('../modules/redis'); module.exports = function (app) { var redisClient = redis.init(); app.post('/auth/ticket', cors(), function (req, res) { var hashes = ['hash1','hash2', 'hash3']; var candidates = []; // An array to collect valid hashes var...

Getting values with jedis pipeline

java,redis,pipeline,jedis
I have a list of ids that I want to use to retrieve hashes from a Redis server using the java client jedis. As mentioned in the documentation, Jedis provides a way to use the pipeline by declaring Response objects and then sync the pipeline to get values: Pipeline p...

Using redis as a DB for some values

node.js,redis
I notice that all the examples of redis contains key-value option. For example: key1 value1 key2 value2 key3 value3 But my DB is more complex, and I wish to support some values of keys. key1 createday1 deleteday1 size1 key2 createday2 deleteday2 size2 key3 createday3 deleteday3 size3 Also, I wish to...

Cache invalidation strategy

caching,redis
In my current application, we are dealing with some information which rarely changes. For performance optimization we want to store them in cache. But problem is in invaliding these objects whenever these are updated. We have not finalized the caching product. As we are building this application on Azure, we...

Facing issues while migrating to Redis session state

c#,asp.net,asp.net-mvc-4,session,redis
I am changing the session management provider from inproc to Redis session state to resolve the shared session problem for Web Garden and for better performance of my MVC application. Problem with using Redis is that classes must be serialized before putting in the session which requires a lot of...

Not able Scan using redis template

redis,spring-data-redis
I am trying to use SCAN http://redis.io/commands/scan to iterate over all the keys present in redis. But the Redis template provided by spring do not have any scan() method. Is there any trick to use the above? Thanks...

in redis-py , is redis.StrictRedis.pipe thread safe?

python-3.x,redis,redis-py
short question. I'm using redis-py to set some keys on my redis server and I'm experiencing some weird behaviour. I suspect it has something to do with the StrictRedis.pipe. I have multiple threads pushing commands to the same pipe and after a while I run execute on this pipe and...

JedisMovedDataException (When using sadd with pipeline)

redis,jedis
I have a 3 node EC2 redis cluster setup and I am trying to add records to redis (using sadd) with pipeline mode. I get the following error after adding about 70/82 and 81 keys in 3 nodes: Exception in thread "main" redis.clients.jedis.exceptions.JedisMovedDataException: MOVED 1539 172.31.59.103:6379 at redis.clients.jedis.Protocol.processError(Protocol.java:93) at redis.clients.jedis.Protocol.process(Protocol.java:122)...

Node.js: Redis security clarification

javascript,node.js,security,redis
I have two servers, ServerA - nodejs server in production, already has an authentication module, very little freedom to modify code, I have added a module, that provides a token key to serverB. ServerB - nodejs server, not in production, more freedom to change code, since it should not have...

How to connect to the same redis db with Predis and redis-cli?

php,redis,predis
While playing around with redis, I notice that, connecting with Predis and redis-cli lead to different keyspaces both with the name db0. Both connections were made to a redis-server running on tcp://localhost:6379. I can see that the dumps are in different locations aswell. Here's the info from both instances :...

Using Redis to store array of hashes

arrays,ruby,redis,hashes
I have just started to look at Redis and would like to be able to store an array of hashes, where i can pop a random key/value out and then put it back in when i need to. So in Ruby i would have something like this users = [{...

Redis Cluster in multiple threads

multithreading,redis,thread-safety,connection-pooling,jedis
Im currently using Redis Cluster Mode with 3 master instances, i'm using Jedis(Java client) in listening server which every data received i create a new thread then the thread make an update in redis. My question is how can i use Redis Cluster instance in multiple thread with pool configuration....

Redis - linux / Error when Installing redis on linux: `cc: command not found`

linux,redis
I wish to install redis on my red-hat environment. I do the following: wget http://download.redis.io/redis-stable.tar.gz tar xvzf redis-stable.tar.gz cd redis-stable make I got the next error: make[3]: *** [net.o] Error 127 make[3]: Leaving directory `/tmp/redis-stable/deps/hiredis' make[2]: *** [hiredis] Error 2 make[2]: Leaving directory `/tmp/redis-stable/deps' make[1]: [persist-settings] Error 2 (ignored) CC...

Using SORT command to get HASH fields from a sorted set in Redis

sorting,redis,hashmap,sortedset
For example, in redis-cli I've tried to create a sorted set like this: zadd sortedset 1 1 2 2 3 3 And I've created a hash like this: hset data 1 hello hset data 2 goodbye hset data 3 sir My goal is storing identifiers in sorted sets and get...

Can I use Pivotal's Redis and RabbitMQ for Cloud Foundry on Pivotal Web Services

redis,rabbitmq,cloudfoundry
Currently, the only RabbitMQ service on PWS looks kinda iffy. I was wondering If I could use Pivotals solutions https://network.pivotal.io/products/p-redis https://network.pivotal.io/products/pivotal-rabbitmq-service On Pivotal's own http://run.pivotal.io , or If to run theseI have to have an on premises Cloud Foundry. Can I run these on Pivotal Web Services? ...

Can Bluebird Promise work with redis in node.js?

javascript,node.js,redis,promise,bluebird
Here's my original code to fetch a user php session which is stored in redis: var session_obj; var key = socket.request.headers.cookie.session session.get('PHPREDIS_SESSION:'+key,function(err,data){ if( err ) { return console.error(err); } if ( !data === false) { session_obj = PHPUnserialize.unserializeSession(data); } /* ... other functions ... */ }) I would like to...

Celery worker with Redis broker can't execute Django task

redis,celery,django-celery,celery-task,celerybeat
I'm learning Python(2.7)/Django(1.5) these days via developing my own Reddit clone (on ubuntu 14.04 LTS). I'm trying to incorporate Celery(3.1) with Redis into the mix, using it to periodically run a ranking algo as a task (on my local set up). But unfortunately, I can't get this simple task to...

Docker-compose , anyway to specify a redis.conf file?

redis,docker,docker-compose
my redis container is defined as he standard image in my docker_compose.ml redis: image: redis ports: - "6379" I guess it's using standard settings like binding to Redis at localhost I need to bind it to 0.0.0.0, is there anyway to add a local redis.conf file to change the binding...

SignalR Scale out using a backplane

sql-server,redis,scaleout-hserver
I am confused on a design architecture using a SQL server as a back-plane. My question is can I use Redis as a back-plane and also have SQL serving my user information separate from SignalR messages. I am just very lost on where my SQL server database would fit into...

NoSQL DB for searching in vector space

vector,redis,cassandra,nosql,distance
I am completely new to NoSQL DBS such as Cassandra, Mongo, Redis, etc. and I want to create this type of a structure : { "item_id": "ABC1", "x1": 0.55, "x2": -0.29, ... "x100": 0.17 } Basically, I have millions of items and 100 floats associated with each of them. My...

Travis gives me Redis connection to localhost:6379 failed - connect ECONNREFUSED

node.js,redis,travis-ci
I'm trying to test a node.js module using Travis, but all I get is "Redis connection to localhost:6379 failed - connect ECONNREFUSED". Can someone please tell me what am I doing wrong? The latest build is at: https://travis-ci.org/luiselizondo/config-persistence/builds/65187913 Thanks...

Can RPUSH and LPUSH in Redis race?

transactions,redis,race-condition
The docs at redis.io on RPUSH and LPUSH aren't clear on whether or not these operations are still O(1) and transational when pushing multiple items. For example, if two clients perform an RPUSH to the same list with multiple items, can their items become interspersed and thus out of order?...

What is the use of privdata argument in redisAsyncCommand?

c,redis,hiredis
The function definition provided in the source for redisAsyncCommand( ) is: static int __redisAsyncCommand(redisAsyncContext *ac, redisCallbackFn *fn, void *privdata, const char *cmd, size_t len) { ... } What is the purpose of the void *privdata argument? In what cases would it be useful?...

Laravel Redis configuration

php,redis,laravel-5
I am currently creating an app with Laravel and Redis. Almost everything is working fine. I extended the Authentication as explained in the documentation, users can subscribe, login, logout ... I can create content and everything is stored in Redis. But I have one issue. I can't run commands like...

StackExchange.Redis - best way to wait for a lock

redis,stackexchange.redis
I have the following method that waits for an exclusive lock on a Redis key. This method works but I'm wondering if there is a better way without a for loop and a Thread.Sleep. /// <summary> /// wait up to 2 seconds to achieve a lock! /// The lock is...

I'm trying to import an external Redis database (.RDB file) on a Redis installation on Windows but the new data is not being loaded?

database,import,redis,nosql
I have been trying for hours to import a .RDB Redis database file into a new installation on my local machine. I have followed all the steps on Stackoverflow stating to basically drop the dump.rdb into the installation folder (i.e. what it's condifured to read in the .conf file. See...

What's an idiomatic way to reconnect to Redis subscription in Go?

go,redis,redigo
I am using the redigo library to try to subscribe to a Redis channel and then handle a published message. How do I handle the case where it errors out? Here's what I came up with. Is this a good way to do it? Is there a better way? Note:...

How to understand text language in utf8 encoded text?

node.js,utf-8,character-encoding,redis,language-detection
Redis is using utf8 code and for my project I need to get text language which is utf8 encoded text. Is there any way that can give a clue about the language of the text? EDIT: My project is on NodeJs programming language. In Redis maybe lua script has a...

node js redis pubsub

mysql,node.js,redis,publish-subscribe
I'm really beginner of nodejs. I want to make a chatting service using nodejs. I use nodejs/jade/mysql to construct basic part of my system and now i want to provide pub/sub to users. we receive users' interests from text field or using hash tags..(anyway we received users' interests and stored...

nginx uwsgi websockets 502 Bad Gateway upstream prematurely closed connection while reading response header from upstream

django,nginx,websocket,redis,uwsgi
I've been banging my head on this issue for days now and have finally reached a brick wall. I've been trying to get my stack to run: http://django-websocket-redis.readthedocs.org/en/latest/running.html#django-with-websockets-for-redis-behind-nginx-using-uwsgi I've been looking at some other SO articles like this one: nginx - uWSGI HTTP + websocket config They seem to have...

Can't connect to redis on heroku

ruby-on-rails,ruby,heroku,redis,sidekiq
I'm using sidekiq with active_job in my rails application. The job currently works but I am unable to get connect to the Redis when deploying to heroku. In heroku I have the RedisToGo addon. When pushing to heroku I get the following error. error /app/vendor/bundle/ruby/2.2.0/gems/redis-3.2.1/lib/redis/client.rb:331:in `rescue in establish_connection': Error connecting...

How does Redis Cluster handle replication for sorted sets ZSET (and others)?

data-structures,redis,sortedset
Redis Cluster supports sorted sets. How is the replication login implemented if used with a replication factor > 1? Is the master node forwarding all actions applied against the sorted set to the replica nodes or is there some other mechanism (e.g. copying the whole set over the wire everytime...

Predis: Pros and Cons of the two cluster strategies

php,session,redis,cluster-computing,predis
I am using Predis to connect to a Redis 3.0.2 cluster. So, I have an option to use either predis or redis cluster strategy. I am wondering if there are any significant pros and cons of choosing one of them over the other? Based on my wandering through documentation, I...

Socket.io redis How data stored and cleared

redis,socket.io,socket.io-redis
i am hosting an app on heroku which is using socket.io. it is using sockets and i am using heroku 4 standard 1X dynos . So for this i used redistogo service and socket.io-redis plugin. it's working great but i want to know does socket.io-redis also clear the data from...

Error starting sidekiq on Heroku, missing sidekiq.log file crash

ruby-on-rails,ruby-on-rails-4,heroku,redis,sidekiq
I'm new to using sidekiq & redis and am trying to get sidekiq to run on Heroku, but it seems to crash each time I deploy my Rails 4 app. I get this error in Papertrail: May 03 11:16:37 myapp app/worker.1: No such file or directory @ rb_sysopen - ./log/sidekiq.log...

Camel Thread Id changing when calling http component

java,redis,apache-camel
My route is like this: from(rabbitmq). to(redisLockerProcessor). to(processor1). to(ahc://http:).to(processor2) .to(redisLockReleaseProcessor) I am using redisson library which stores thread id which took the lock in redis. But in redisLockReleaseProcessor it is throwing exception that thread id is not same as thread id which took the lock. How does http components thread...

Why do I need a broker for my production ELK stack + machine specs?

elasticsearch,redis,logstash,kibana
I've recently stood up a test ELK stack Ubuntu box to test the functionality and have been very happy with it. My use case for production would involve ingesting at least 100GB of logs per day. I want to be as scalable as possible, as this 100GB/day can quickly rise...

Loop until i get correct user

ruby,redis
I have users stored in Redis and want to be able to call only certain subsets from a set, if i don't get the correct user back i want to put it back in the set and then try again until i get one of the desired users @redis =...

Set options for ZADD command in laravel redis

php,laravel,redis,set
I'm trying to set options for ZADD with laravel redis but am failing. The option I need to set is NX, as stated in the documentation: ZADD options (Redis 3.0.2 or greater) ZADD supports a list of options, specified after the name of the key and before the first score...

Redis: Race Condition and Single threaded

redis
I'm new to Redis and going through Redis in Action book, which elaborate on Race Conditions and different Locking mechanism to avoid it.(There is one dedicated chapter on it). But in some of the StackOverflow Posts it is discussed that Redis is Single Threaded. The link is as follows :...

Redis remote connection security concern

php,node.js,redis
I'm using Redis to store PHP sessions to have an access to them in Node.js through the same server. How can I ensure that the client connection to redis is restricted to localhost only ? I afraid someone will connect to my Redis server in a remote connection and gain...

Redis ServiceStack Native Client Instantiation Specifying connection settings

c#,redis,stackexchange.redis
I'm having some issues with the ServiceStack Redis client. Right now, I'm able to create a client specifying the hostname and the port, but what about passwords or multiple servers. Im doing it like this: protected IRedisNativeClient GetRedisClient() { if (_RedisHostName == null) { _RedisHostName = ConfigurationManager.AppSettings.Get(REDIS_HOST_SETTING_KEY); _RedisPort = Int32.Parse(ConfigurationManager.AppSettings.Get(REDIS_PORT_SETTING_KEY));...

how get all keys who answer value conditions

node.js,redis
I'm trying to use Redis and I would like obtain a result according to the values. For example: redis.hmset("user:"+id, "statut", 3); redis.hmset("user:"+id, "statut", 2); redis.hmset("user:"+id, "statut", 2); I want have all keys which statut: 2 Is it possible with Redis and node JS ? Thanks a lot....

using Go redis client (Redigo)

go,redis
I'm using GO redis client redigo to write image to ~20 redis servers. speed is an important factor here and I'm just sending set commands to the redis so I'm using Send and Flush without calling Receive. after a few hours I'm getting "connection reset by peer" on the client....

Implementing following stream

redis
I am developing an app for photo sharing and having follow system so whosoever follow x user then x users photo will come in his following . I am storing my data in redis as following sadd rdis_key+user_id photo_id set redis_key+photo_id+data data_of_photo sadd redis_key+follow+user_id follower_id Now I want to get...

Is exists check required before calling StringSet method of StrackExchange.Redis

c#,redis,stackexchange.redis
I am using the StackExchange.Redis 1.0.450 nuget in C#. I have code like below which checks if a keyexists in redis before adding it - if (!Cache.KeyExists(fKey)) { Cache.StringSet(fKey, Serialize(data)); } where Cache is Database object I was reading about the redis SET command here http://redis.io/commands/set and found that SET...

Why A single Jedis instance is not threadsafe?

redis,thread-safety,pool,jedis
https://github.com/xetorthio/jedis/wiki/Getting-started using Jedis in a multithreaded environment You shouldn't use the same instance from different threads because you'll have strange errors. And sometimes creating lots of Jedis instances is not good enough because it means lots of sockets and connections, which leads to strange errors as well. A single Jedis...

Spring Session – Support for other Backend Implementations other then Redis [closed]

spring,redis,spring-boot,couchbase,spring-session
I would like to use "Spring Session" in my current project, but it seems that currently only Redis is a supported backend database. The official documentation is not talking about any other support yet. Are there alternative implementations for other databases? For example, what about Memcached or Couchbase Support, which...

Naming Convention and Valid Characters for a Redis Key

redis
I was wondering what characters are considered valid in a Redis key. I have googled for some time and can not find any useful info. Like in Python, valid variable name should belong to the class [a-zA-Z0-9_]. What are the requirements and conventions for Redis keys?...

Azure Redis Cache vs Redis Cloud service on Azure

azure,redis,stackexchange.redis
I need to use it in a .NET (webapi) app & using stackexchange.redis nuget package. Appreciate if someone please point me to appropriate resources for following - 1) Can I choose any of Azure Redis cache or Redis cloud service if I interface through stackexchange.redis nuget? 2) Azure Redis Cache...

RESP formt for HMSET in REDIS

redis
I am trying to mass insert a table data into redis hash using RESP, using the traditional SQL at Oracle side. I have constructed the RESP protocol format for the data: table data: col1-----col2 v1-----v2 RESP format: "*6\r\n$5\r\nHMSET\r\n$4\r\nkey1\r\n$4\r\ncol1\r\n$1\r\n1\r\n$4\r\ncol2\r\n$1\r\n2\r\n" "EDIT: saving this output in a file, to feed it to the...

Querying in redis from node.js

mysql,node.js,redis
I am coming from a traditional SQL background and am learning Redis. Specifically I am trying to run a redis database along with node.js I have got the initial setup of redis done and tried out few of their basic commands. However I would like to create a database which...

Why use Flask's Redis extension?

python,flask,redis
What is the advantage of using the Flask Redis extension in this example... from flask import Flask, render_template from flask.ext.redis import Redis app = Flask(__app__) app.config['REDIS_HOST'] = 'localhost' app.config['REDIS_PORT'] = 6379 app.config['REDIS_DB'] = 0 r = Redis(app) @app.route("/") def index(): return render_template("index.html", **r.hgetall("temp.index")) ...over a regular Redis connection instance? from...

Openshift redis cartridge with strange exceptions ETIMEDOUT on socket.io script

node.js,redis,socket.io,openshift,openshift-cartridge
I have a socket.io node script running that acts as a chat server. I had it running on a local server ok, and have since tried moving it over to openshift. I used the following cartridge to get it working - https://github.com/smarterclayton/openshift-redis-cart/issues While running the local version of the server,...

Never ending stream with Baconjs

javascript,node.js,redis,reactive-programming,bacon.js
I have a simple script which just take all values from Redis list and print them to console. var redis = require("redis"), client = redis.createClient(); Bacon = require('baconjs'); Bacon.repeat(function(){ return Bacon.fromNodeCallback( client, 'lpop', ['errors'] ); }) .takeWhile(function(val) {return val !== null;}) .fold( [], function(acc, next) { acc.push(next); return acc; }...

Disable Laravel Redis Cache

laravel,redis
i have set up the laravel Eloquent ORM query with Redis cache, i.e ->remember(10)->get(), for 10 mintues cache, however, i want to disable all the cache somehow when I am working on the development site, on production site, the cache need to be turned on. how can I turn on...

How to determine there are no running jobs or consumer process exit

data-structures,redis
In our business scenarios, we have a job queue, one producer process and several consumer processes.The producer only put new jobs into the queue when all consumers has no job running. The consumer may die or stuck. If that consumer not working any more, the producer should consider this dead...

Redis: Delete user token by email ( find Key by Value )

node.js,express,redis
I have followed tutorial on how to create token-based authentication with node from this tutorial http://www.kdelemme.com/2014/08/16/token-based-authentication-with-nodejs-redis/ I got it all worked out, but I got 1 problem. The way I store token is : KEY = TOKEN VALUE = UserData (Username, email, etc.) To protect multiple devices login, I would...

Update Dictionary object in redis cache using StackExchange.Redis client

c#,caching,redis,stackexchange.redis,azure-redis-cache
I am using azure redis cache and StackExchange.redis client to access it. I am trying to figure out what is the best way to update dictionary values in redis. public async Task<T> FetchAndCacheAsync<T>(string key, Func<Task<T>> retrieveData, TimeSpan absoluteExpiry) { T value; var output = await _cache.StringGetAsync(key); if (output.HasValue) { value...

php implememnt a queue with redis

php,mysql,redis
I wrote a very simple queue using redis, but I think my implementation is bad, so I want to ask for a better solution. Below is a simple flow chart of my problem. some program push data into a redis list a php program loop forever, check if the list...

What is the fastest way to read multiple hashes from Redis?

redis,predis
I have a LIST containing pointers to some HASH data. Something like: [LIST] app:1 ["article1", "article2", "article3" ...] [HASH] article1 {title: "Hello", description: "World"} [HASH] article2 {title: "Hello", description: "World"} [HASH] article3 {title: "Hello", description: "World"} Upon having this request: api/v1/app/1/articles/20 I do the following: $pointers = $this->redis->lrange($appID, 0, $request->articles);...

Inadequate RAM usage by Redis

python,memory,go,redis,redigo
I'm developing an API using Go and Redis. The problem is that RAM usage is inadequate and I can't find the root of the problem. TL;DR version There are hundreds/thousands of hash objects. Each one of 1 KB objects (key+value) takes ~0.5 MB of RAM. However, there is no memory...

Ordered set in Redis based on more than one criteria

redis,order,set,unix-timestamp
I am trying to create a redis ordered set. The catch is the ordering need to be done based on two criteria, timestamp and score. But in redis, I can only provide one soring criteria: ZADD {key} {timestamp} {value} How to add score in this ordering as well plz? Update:...

Should redis zscan on sorted set return my results sorted by score order?

redis,sortedset
For an application I'm working on I'm looking at using a sorted set in Redis to store items with a timestamp as the score and an arbitrary message as the member. I was then planning on using zscan to be able to retrieve items from the sorted set in order....

Redis AUTH command in Python

python,redis
I'm using redis-py binding in Python 2 to connect to my Redis server. The server requires a password. I don't know how to AUTH after making the connection in Python. The following code does not work: import redis r = redis.StrictRedis() r.auth('pass') It says: 'StrictRedis' object has no attribute 'auth'...

Redis - How to expire key daily

node.js,unix,redis,timestamp,sails.js
I know that EXPIREAT in Redis is used to specify when a key will expire. My problem though is that it takes an absolute UNIX timestamp. I'm finding a hard time thinking about what I should set as an argument if I want the key to expire at the end...

Hiredis fails when deploying with capistrano

ruby-on-rails,redis,capistrano,hiredis,redis-rails
When trying to deploy an app with ruby 2.2.0 and rails 4.2.0 with gems redis v3.0.1 and hiredis v0.4.5 task which responsible for interactions with redis server fails with the following error: .....ruby/2.2.0/gems/hiredis-0.4.5/lib/hiredis/ext/hiredis_ext.so: undefined symbol: rb_thread_select cap aborted! Does anyone faced the same issue?...

Redis: intersection of sorted sets by score

node.js,google-app-engine,redis,node-redis,sortedset
I want to store location triples in a Redis datastore, but want to make them searchable as well. This would make it possible to do range queries, like 'give me al points with 1 < x 3 and y > 2'. Therefore, I use a combination of sorted sets. Each...

SncRedisBundle not working, what am I doing wrong?

symfony2,redis,symfony-2.6
snc_redis: clients: default: type: predis alias: default dsn: redis://localhost session: client: session prefix: session_ use_as_default: true The above is my current snc_redis config in config.yml I added defined snc_redis as my session handler id by doing the following: framework: ... session: handler_id: snc_redis.session.handler The error I get: The service definition...

How change redis to be persistent

redis
I use redis. I want that the DB will be persistent, but when I kill my process, I notice that the data doesn't recover. In example, I have 100 keys and values. my process run on id = 26060. When I do: kill -9 26060 and run redis-server again, all...

ServiceStack Redis latest list by date

c#,model-view-controller,redis,servicestack
If I have a class public class Article { public int Id { get; set; } public string Title { get; set; } public string ShortDesc { get; set; } public DataTime UpateDate { get; set; } } What is the best way of getting list of users from Redis...

nodejs Kue job processing logic

node.js,redis,kue
I have a very simple logical question. I will be running job processing logic on a separate app server. My job processing app will be a standalone app, doing nothing just processing jobs. In my code, how do I make sure that my app continuously keep checking redis server for...

Rails, Redis and Sentinel

ruby-on-rails,redis,redis-sentinel,redis-rails
I have a Redis cluster of 4 nodes, 1 master and 3 slaves, monitored by Sentinel. Now in rails I need to connect to this cluster, reading from the nearest replica, and writing to the master, the same as I do with MongoDB. Using the redis-rails gem, how is it...

Getting a lost Sentinel error message for Redis

redis,spring-boot,spring-data-redis
I am running a spring boot service using spring data redis and here is the following configuration. The service seems to work but I am seeing a stream of Lost Sentinel messages in the logs. The sentinel nodes are reachable form the VM where I am running the service. I...

Docker - Cannot start Redis Service

redis,docker
I'm installation Redis, setting up init.d, placed the redis.conf beside init.d. Then using CMD service init.d start to start Redis. However, Redis-Server does not start, and there are no indiciation in the log file that the service failed to start. Installing Redis and Placing redis.conf to the etc/init.d folder Commands:...

Which maxmemory policies allow expiration in Redis?

redis,nosql,ttl
Which maxmemory policies are compatible with redis expiration mechanisms? Is it only volatile-ttl? Does noeviction stop old records from death?...

Using Redis as a session state provider

asp.net,session,redis,stateless
I am wanting to create real RESTful APIs with ASP.Net. According to REST architecture. The application must be stateless. Meaning I can't use normal sessions. I found a document here describing how to use Redis as a session state provider. Since it would be external (as in not part of...

How To Restore a Missing Redis Service

linux,redis,centos
I installed an older version of Redis on a CentOS server. I tried to remove that old version and update it to latest version, but it seems that the redis service is gone and the new version installation doesn't reproduce it. Is there any way I can uninstall the Redis...

Can I use lpop/rpop to create a simple queue system with Redis?

redis,queue,message-queue
I tried several message/job queue systems but they all seem to add unnecessary complexity and I always end up with the queue process dying for no reason and cryptic log messages. So now I want to make my own queue system using Redis. How would you go about doing this?...

Redis Cluster: Find which master holds particular key/slot

lua,redis
I'm using Redis Cluster, and some keys have a special prefix {foo}, so redis puts them in one slot. I do this because i want to run some lua scripts against these keys (i can do this if i login to the master as a single instance). In my setup...

Use cases for Redis SETBIT, GETBIT, BITCOUNT?

bitmap,redis
After reading Can someone explain redis setbit command? and http://blog.getspool.com/2011/11/29/fast-easy-realtime-metrics-using-redis-bitmaps/ (referenced in the redis docs) I'm still struggling to identify use cases for using SETBIT over SET. The above sources seems to be citing a driving factor for using SETBIT for storing events and 'countable' datasets in binary as it...

Redis Serialization and Deserialization

redis,deserialization,spring-data,serializable,spring-data-redis
I have noticed that some of my serialized objects stored in Redis have problems deserializing. This typically occurs when I make changes to the object class being stored in Redis. I want to understand the problem so that I can have a clear design for a solution. My question is,...

RSQM - polling manually?

javascript,node.js,redis,queue
We are currently restructuring one of our largest projects. The whole project is set up in an Node.js / PHP mixed envorinment and is quite distributed. This is why we are planning to use queueing for various services. We are extensively using Redis in this system, so I came across...

Redis KeyExists then GetValue Optimization

c#,redis,stackexchange.redis
I'm new to using Redis and have written my c# block to be: public string GetValue(string key) { if (IDatabase.KeyExists(key)) { return IDatabase.StringGet(key); } else { //Get value from SQL, put it into Redis, then return it } } My question is, how inefficient is it that I am first...

Expiration of HashMap in Redis python?

python,database,python-2.7,redis,hashmap
I want to store the following hash map in redis: "data": { "name": "XYZ", "age": 22, "address": "a-z" } I want this whole hash map (with the given key) to expire in time, let's say 72 hours. How do I use ttl/expire function in python?...

NodeJS: Cannot start connect-redis with Express 4.12.2

node.js,session,express,redis
I am using express 4.12.2, express-session 1.11.1, & connect-redis 1.4.7. When running the following code with NODE_ENV=production npm start: var session = require('express-session'); var RedisStore = require('connect-redis')(session); app.use(session({ store: new RedisStore(options), secret: 'keyboard cat' })); I receive the following error: var Store = connect.session.Store; ^ TypeError: Cannot read property 'Store'...

Redis - Delete/pop if more than x members in set

performance,redis
In Redis, I have millions of sets with varying quantities of members. I want to reduce the overall size and really only need the latest members added to a set. Is there an operation to pop/delete any members for each key until the total length is 10 or less?...

Sidekiq keeps rebooting Cloud66

ruby-on-rails,redis,sidekiq,bluepill,cloud66
I have been struggling with this issue for a while and just can't figure it out. I am trying to get Redis and Sidekiq to handle background jobs for my Rails Project hosted on Cloud66 w/ Digital Ocean. All needed gems seem to be present and the setup works perfectly...

Low level caching for collection

ruby-on-rails,caching,redis
I want to use Redis to do some low level caching in my Rails app. In a controller I normally us this to get all books: class BooksController < ApplicationController def index @books = Book.order(:title) end end And the view iterates over this: <ul> - @books.each do |book| <li>= "#{book.title}...

Unpack redis set bit string in Go

go,redis,bit-manipulation,bit
Using redis#Setbit to set bit in a key like: redis.Do("SETBIT", "mykey", 1, 1). When I read it using redis#Get like redis.Do("GET", "mykey"), I get a bit string. How do I unpack the string so I can get a slice of bools in Go? In Ruby, you use String#unpack like "@".unpack...

Redis Cache .Net Client

.net,redis,server
Does anyone know if Amazon supports C# client libraries for making calls to Redis Server? I know service stack and stack exchange are the only two libraries right now, but Amazon makes no mention of them at all.

Django, socket.io, node.js - Manage private messages and group conversations

django,node.js,websocket,redis,socket.io
I am in the process of writing a back-end for a service such as Facebook Messenger or WhatsApp. I started out following this splendid tutorial: http://www.maxburstein.com/blog/realtime-django-using-nodejs-and-socketio/ I do this with an API written in Python (Django). Along side with this API, I have a Redis process and a node.js server...

Session State with Azure Redis Cache not working on multiple instances

asp.net,azure,redis
I'm using Azure Redis Cache to store the session of the users to share it over multiple instances. But this not working... i'm logged in and as soon as the load balancer directs my request to the other Webserver i'm loggout out on the other server. This is my current...

Redis Sentinel - How to get Config Value?

redis,redis-sentinel
I want to find the number of maxclients for a running Redis sentinel. There is no config set in the .conf file for the sentinel, so I want to find out the current value. However when I connect via redis-cli -p 26379 and enter "config get maxclients", it tells me...

hmset redis with result from mysqlDB

php,arrays,redis
Im very new to Redis, and after have seeing the redis FAQ i have a question regarding hmset. It seems like hmset is the best way for me to store user rows from my mysql DB. So if i had an array returned from mysql like this: array( 'userid' =>...

predis: ZADD with NX keeps throwing error 'Predis\ServerException'

redis,predis
I am having an issue when I try to add "NX" to the zadd command on predis. The redis docs say that ZADD should support NX, but no matter how I set up the predis command, I can not get it working. Does anyone have any experience with this issue?...

How to check Resque worker status to determine whether it's dead or stale

ruby-on-rails,ruby-on-rails-3,heroku,redis,resque
The default resque web interface says that I have 5 of 7 workers working. I don't understand how this could be happening. I'm on heroku, so when my dyno restarts, it should spin down existing dynos and workers, then spin up new ones. So, I'm assuming some of these workers...