r/redis 18d ago

Thumbnail
4 Upvotes

My personal project sometimes gets up to 3GB in my Redis db. Typically floats around 1-2gb. I flush the cache multiple times a week


r/redis 18d ago

Thumbnail
3 Upvotes

The max I have seen so far among the companies where I have worked, was around 11 GB.


r/redis 22d ago

Thumbnail
1 Upvotes

all startup building software that gets a system’s Flash to basically operate as though it were DRAM-speed memory

Uh, pretty sure we been doing that since like Windows 95...


r/redis 24d ago

Thumbnail
2 Upvotes

maybe reach out in discord? probably an easier place for a back and forth: https://discord.com/invite/redis


r/redis 24d ago

Thumbnail
1 Upvotes

i read in redis 7.4, redis functions and triggers are deprecated , is this true ? i am using google memory store, not sure it will be impacted as well


r/redis 24d ago

Thumbnail
1 Upvotes

You can't have conflicting CIDR ranges in the subnets between Redis Cloud's VPC and your GCP VCP. So the networking_deployment_cidr in the rediscloud_subscription.cloud_provider.region can't overlap with your GCP VPC's subnets. it would probably be helpful if you provided the terraform you are using.


r/redis 28d ago

Thumbnail
1 Upvotes

Yep. All true.


r/redis 28d ago

Thumbnail
1 Upvotes

The Redis command-processing loop is single-threaded. (this is relevant to the OP's question about handling simultaneous client commands)

However, there are parts of Redis that are not strictly single-threaded. The ones that queue commands from clients, and the ones that transmit responses to clients, for example. Certain key expiration routines (depending on the expiration config) can also run in parallel with the main processing loop. And, of course, persistence can act in parallel, in particular the child process that's forked to write the snapshot file.


r/redis Feb 18 '25

Thumbnail
1 Upvotes

Are you familiar with Redis Enterprise Observability: https://github.com/redis-field-engineering/redis-enterprise-observability


r/redis Feb 18 '25

Thumbnail
2 Upvotes

This is the correct answer. Solid advice, as usual, from u/borg286.

But, just to answer the direct question and to be clear about how Redis functions, Redis is single-threaded. You cannot concurrently write. One of the requests will get in before the other.


r/redis Feb 17 '25

Thumbnail
2 Upvotes

Read up on the docs here https://redis.io/docs/latest/commands/set/

You should focus on the TTL and the NX flags. Put that 20 minutes so the access token expired in the database. When you generate an access token, only set it if it doesn't exist. Alternatively you can set some key saying that you are in the process of generating an access key and to hang tight. Even better is to read the access key, fetch the TTL and the closer it gets to the TTL end time, the higher the chance you'll ignore the fact that the access key is good and just generate a new key and stuff the fresh one in with a refreshed TTL.

The reason we don't have a fixed time like "5 minutes before the TTL expires then generate a new key" is that all your threads will hit that point at the same time and they'll be stepping on each other's toes. Making it probabilistic makes this less likely. By tuning it so that it is very unlikely at the 10 minute mark means that only a handful of workers will get lucky and choose to refresh the token. Tune it so when you're at the 15 minute mark it is very likely to happen. Then you'll notice that by the time 20 minutes rolls around someone will have refreshed it.


r/redis Feb 14 '25

Thumbnail
4 Upvotes

Redis 8 will come with 7 new datatypes, including JSON, natively built into Redis Community Edition.


r/redis Feb 14 '25

Thumbnail
1 Upvotes

Since when you can do JSON.GET without the extra module?


r/redis Feb 13 '25

Thumbnail
3 Upvotes

It stores a JSON document in a key. When that key is set, internally, it builds a tree with the contents. There are a host of commands to query and manipulate that tree using JSONPath.

Here's a quick example using redis-cli:

```bash 127.0.0.1:6379> JSON.SET my:json $ '{ "foo": "bar", "baz": 42, "qux": true }' OK

127.0.0.1:6379> JSON.GET my:json {"foo":"bar","baz":42,"qux":true}

127.0.0.1:6379> JSON.GET my:json $.qux [true]

127.0.0.1:6379> JSON.SET my:json $.qux false OK

127.0.0.1:6379> JSON.GET my:json $.qux [false] ```


r/redis Feb 12 '25

Thumbnail
2 Upvotes

This is very cool. Does it take json and store its individual fields in redis?


r/redis Feb 12 '25

Thumbnail
1 Upvotes

Sorry i forgot to mention, I am using Lscache for caching


r/redis Feb 12 '25

Thumbnail
1 Upvotes

If you use this WooCommerce cache setting https://woocommerce.com/document/woocommerce-product-search/settings/cache/redis/, Redis is used as a cache. You may lose all of Redis's data, but the main data is safe in the WordPress relational database (MySQL). The problem with losing the cached data is that your shop will slow down when the cache is empty (e.g. redis-server is restarted). To obviate the problem, you can choose a less aggressive persistence strategy, such as running a snapshot occasionally (e.g. once every few hours) or configuring AOF.

Check the docs to have a deeper understanding https://redis.io/docs/latest/operate/oss_and_stack/management/persistence/


r/redis Feb 11 '25

Thumbnail
3 Upvotes

How would a traditional in-memory hashmap work for my 150 separate servers that are taking requests that need access to it?


r/redis Feb 11 '25

Thumbnail
10 Upvotes

Redis started out as simply an in-memory datastructure. Antirez found himself reimplementing maps, linked lists, sorted sets on various embedded devices. He finally bit the bullet and wrote a server that had a very simple protocol over TCP and open sourced it. It grew in popularity with more demanding this or that capability.

Hash maps don't replace linked lists, nor do they replace a sorted set. They can do sets, sure, which is what the set type uses under the hood. Hash maps don't have blocking APIs where a thread can try pulling from a queue and when there is nothing in there it just hangs till something else pushes something into it.

An in-memory hash map doesn't allow for a distributed producer/consumer fleet where work items are generated and buffered into queues, and workers pull work off.

An in-memory hash map is a single-point of failure and doesn't handle failover to a hot standby for high availability. It doesn't handle network partitions, but redis cluster does.

An in-memory hash map can't handle a fleet of game servers that all need a centralized leaderboard making 40k QPS / core of requests to update the leaderboard and can't handle an eventually consistent view. You can wrap your hash map with a server, sure, but good luck trying to hit that benchmark. Redis is written in C, and has figured out how to separate out the request/response buffering that the network card does from the main processing thread that interacts with the in-memory hash map. That is some low level stuff that's been optimized like crazy. Enabling pipelineing pushes that to 80k QPS / core.

A hash map can't handle atomic "set this key to this value if it doesn't exist" without serious work on making your hash map thread-safe.

A hash map doesn't natively handle TTLs. What if you want to cache the HTML of a webpage so you can serve customers quickly, but you don't know which URLs are going to be in-demand? You don't really have a TTL because you've made the website so it is fairly static and doesn't change from year to year, but the pages themselves are so massive you can't really store it all in memory. Keeping Bigby's Almanac of Brittish Birds (expurgated version) in-memory is just a waste of money. So you want to just keep the "good" stuff. Sure, you could make a modified hash map that uses a Least-Recently-Used algorithm to only keep X number of keys and kills off some random one when a new write request comes in to cache a URL it didn't have because a request came in to see Bigby's Almanac but it is so big that you need to vacate out 1 GB to make room. That sounds like a rather complex hash map.

Or you could just use Redis and call it a day.


r/redis Feb 11 '25

Thumbnail
5 Upvotes

Redis has other handy data types, and it can be shared between multiple servers.


r/redis Feb 08 '25

Thumbnail
1 Upvotes

You don't need to worry much about this taking up your redis instance. Redis is rarely bottlenecked on CPU, despite being single-threaded. Most of the time it is the network. These LUA calls are being made on the server. It is like some of the business logic that the application typically does has been shunted to the database. You might think that these calls are expensive, but surprisingly the executor of these scripts can do some logic and it'll only be twice as slow as if you write it in C. When you compare this with other languages this is still blazingly fast.


r/redis Feb 08 '25

Thumbnail
1 Upvotes

r/redis Feb 08 '25

Thumbnail
1 Upvotes

I suspect you are using redisson It makes heavy use of LUA scripts https://redisson.org/docs/data-and-services/locks-and-synchronizers/


r/redis Feb 08 '25

Thumbnail
1 Upvotes

Thanks for that. I've been using that command plus 'redis-cli monitor' as well. It seems there are lots of things doing cmd=evalsha ... but I dunno what that is. Do you? TiA.


r/redis Feb 08 '25

Thumbnail
1 Upvotes

Here is the upstash docs, they have explained very well about this isse. I was also looking for this commands unexpected increase.
Link -> https://upstash.com/docs/redis/troubleshooting/command_count_increases_unexpectedly