Questions tagged [redis-py]

A Python interface to the Redis key-value store.

A Python interface to the Redis key-value store.

redis-py is developed and maintained by Andy McCurdy (sedrik@gmail.com).

It can be installed in your python environment using pip install redis or if you download the source from above link you can run python setup.py install

221 questions
0
votes
2 answers

Mark standalone redis as read-only

I want to mark a standalone Redis server (not a Redis-Cluster, not a Redis-Sentinel) as read-only. I have been googling for this for quite sometime but I don't seem to find a definite answer (Almost all answers point to Clustering or Sentinel). I…
Kamehameha
  • 5,423
  • 1
  • 23
  • 28
0
votes
1 answer

Multiple connection strings using redis-py

I'm trying to configure multiple connection strings for a single ConnectionPool in redis-py. Our Redis nodes are sitting behind a reverse proxy (let's say NGINX), of which we have multiple for increased redundancy. The idea is to initialize the…
Tim Specht
  • 3,068
  • 4
  • 28
  • 46
0
votes
1 answer

What exactly is this ZINCRBY statement doing?

I am reading Josiah Carlson's Redis in Action. And in the second chapter there is code like this: conn.zadd('viewed:' + token, {item: timestamp}) conn.zremrangebyrank('viewed:' + token, 0, -26) conn.zincrby('viewed:', -1, item) # What is this…
ng.newbie
  • 2,807
  • 3
  • 23
  • 57
0
votes
1 answer

Connection pool to external services (redis) in pyramid

I need to create a global connection pool to redis redis.BlockingConnectionPool what would be the best way to initialize this and where to do it. So I can always have access to to them and those connections can always be open for very fast access. I…
CodeSamurai777
  • 3,285
  • 2
  • 24
  • 42
0
votes
1 answer

Redis WRONGTYPE Operation against a key holding the wrong kind of value using redis-py when calling hgetall() using keys retrieved from scan_iter

I have a redis instance that stores data as hash. the hash key looks something like "o:t:23:45". I'm using redis-py and I am able to get list of keys. for key in rc.scan_iter(): …
Aakash Howlader
  • 3
  • 1
  • 1
  • 3
0
votes
1 answer

Connecting to redis-server using a website-type URL in Python

I have this URL, suppose https://abc.xyz.net/pqr/redis. Basically, this is the url made for serving ipaddress:port of redis-server. I want to ask how can I connect to such type of url, using python. Just an additional info, the redis-server is…
Sajal
  • 96
  • 1
  • 5
0
votes
0 answers

Redis shared resource - two or more python scripts update the same hash but different keys, what happens?

I'm designing a data pipeline where I need to run several python scripts in parallel updating Redis hashes and ttl, they will update same hashes but different keys. Although each will update hash TTL also. Would I face the shared resource issue? I…
talkhouon
  • 21
  • 5
0
votes
1 answer

Redis mget not working as expected with redis-py-cluster client

I am using "redis-py-cluster" to connect to our Redis cluster. We have a requirement to query 100 keys from redis cluster in one call. I use redis hashtags (with {}) to hash all the keys to one node(Ex: {feed}1,{feed}2,{feed}3 are some sample keys).…
umm
  • 1
  • 1
0
votes
0 answers

Restoring large hash (> 1GB) from rdb file in Redis

My Redis database currently has a large hash table - approx. 130m key/value pairs where each key and value is an integer (obviously stored as string). The hash works fine in the database and consumes < 10GB of memory of 64GB total system memory, per…
Harry
  • 4,660
  • 7
  • 37
  • 65
0
votes
1 answer

How we can use redis pipeline in django-redis?

I want to use Redis pipeline (execute multiple commands) in django-redis. We can use multi and exec command in Redis but how we can in django-redis ? One solution is : I have list of hash keys i want to get all hashes using of hash key. On every…
0
votes
3 answers

When do Redis PUB/SUB events fire-and-forget?

Redis events are fire-and-forget. If no one is listening, they will just remain undetected. There's no history. But nowhere on the internet did I find anything that answers the following question (I'm using redis-py and aioredis for python): Does…
fameman
  • 3,451
  • 1
  • 19
  • 31
0
votes
1 answer

Compress in Java, decompress in Python - snappy/redis-py-cluster

I am writing cron script in python for a redis cluster and using redis-py-cluster for only reading data from a prod server. A separate Java application is writing to redis cluster with snappy compression and java string codec utf-8. I am able to…
roottraveller
  • 7,942
  • 7
  • 60
  • 65
0
votes
1 answer

python redis and command PUBSUB channels

I'm testing redis-py: https://github.com/andymccurdy/redis-py. I have a hard time figuring out how to call and get output for the redis command PUBSUB channels.
Alfred Balle
  • 1,135
  • 4
  • 16
  • 32
0
votes
2 answers

Redis: how to efficiently check for empty nested key

I have a nested dictionary in my redis store and need to find all records where key_2 == "" then return value in key_3. All key_3 values will then be used to run mysql query to get key_2 value and update the redis store. [ ... task_44903:…
Adam
  • 473
  • 5
  • 21
0
votes
1 answer

Redis pattern: how would you cache free / occupied ressource with expiration?

Here is the problem I was working on this week, and I am kind of hitting a wall here. Let's say I have 100 resources available to do some quick task. What I want to do is for the client, as fast a possible: fetch the first available ressource mark…
daolf
  • 48
  • 9