Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Possible redis bug?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  15 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
zs  
View profile  
 More options Sep 18 2012, 1:40 am
From: zs <zsl...@gmail.com>
Date: Mon, 17 Sep 2012 22:40:21 -0700 (PDT)
Local: Tues, Sep 18 2012 1:40 am
Subject: Possible redis bug?

We have used redis for about 6+ month in production. There are a couple of
issues that I've observed with redis-2.4.4

a) is there a possible memory leak? we've seen memory gone from 200M to 10G
in 6 month, but the data size hasn't changed. We are using mostly hash data
set, using jedis java library. Restarting the server seems to drop the
memory back down.

b) keys command and expire command doesn't seem to work with specific keys?
say i have a key a
set a 10
expire a 10

however, key a is expired, a get still returns 10, though documentation
says that after a key expired, it will be deleted automatically

are these bugs in 2.4.4?

thx, and btw, is redis cluster going to be released anytime soon?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Josiah Carlson  
View profile  
 More options Sep 18 2012, 9:04 am
From: Josiah Carlson <josiah.carl...@gmail.com>
Date: Tue, 18 Sep 2012 06:04:42 -0700
Local: Tues, Sep 18 2012 9:04 am
Subject: Re: Possible redis bug?

On Mon, Sep 17, 2012 at 10:40 PM, zs <zsl...@gmail.com> wrote:
> We have used redis for about 6+ month in production. There are a couple of
> issues that I've observed with redis-2.4.4

There are a few known issues with Redis 2.4.4, which is why 2.4.17 exists ;)

> a) is there a possible memory leak? we've seen memory gone from 200M to 10G
> in 6 month, but the data size hasn't changed. We are using mostly hash data
> set, using jedis java library. Restarting the server seems to drop the
> memory back down.

There are a few potential causes of this, all of which are fixed in
releases up to and including Redis 2.4.17 . I would suggest you
upgrade.

> b) keys command and expire command doesn't seem to work with specific keys?
> say i have a key a
> set a 10
> expire a 10

> however, key a is expired, a get still returns 10, though documentation says
> that after a key expired, it will be deleted automatically

> are these bugs in 2.4.4?

I do not remember such a bug, but my memory may be flawed. Regardless,
you should upgrade to 2.4.17, it should fix your memory bug.

> thx, and btw, is redis cluster going to be released anytime soon?

Sadly, no. Redis 2.6 and sentinel are first, and while cluster has a
lot of work done for it, there is still enough work to be done that
Salvatore isn't even recommending people run it for testing. On the
other hand, Redis 2.6 has been in RC mode for a few months, and
sentinel has been available for several weeks.

Regards,
 - Josiah


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
M. Edward (Ed) Borasky  
View profile  
 More options Sep 18 2012, 12:41 pm
From: "M. Edward (Ed) Borasky" <zn...@znmeb.net>
Date: Tue, 18 Sep 2012 09:41:17 -0700
Local: Tues, Sep 18 2012 12:41 pm
Subject: Re: Possible redis bug?
On Tue, Sep 18, 2012 at 6:04 AM, Josiah Carlson

<josiah.carl...@gmail.com> wrote:

[snip]

>> thx, and btw, is redis cluster going to be released anytime soon?

> Sadly, no. Redis 2.6 and sentinel are first, and while cluster has a
> lot of work done for it, there is still enough work to be done that
> Salvatore isn't even recommending people run it for testing. On the
> other hand, Redis 2.6 has been in RC mode for a few months, and
> sentinel has been available for several weeks.

> Regards,
>  - Josiah

Is Sentinel in the 2.6.0 RC7 tarball, or do I need to go to Github for it?
--
Twitter: http://twitter.com/znmeb; Computational Journalism Publishers
Workbench: http://j.mp/QCsXOr

How the Hell can the lion sleep with all those people singing "A weem
oh way!" at the top of their lungs?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Yifeng Jiang  
View profile  
 More options Sep 20 2012, 8:27 am
From: Yifeng Jiang <uprushwo...@gmail.com>
Date: Thu, 20 Sep 2012 05:27:40 -0700 (PDT)
Local: Thurs, Sep 20 2012 8:27 am
Subject: Re: Possible redis bug?

Hi,

Sentinel is only available in the unstable branch on github.
See: http://redis.io/topics/sentinel

- Yifeng


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
zs  
View profile  
 More options Sep 21 2012, 11:42 am
From: zs <zsl...@gmail.com>
Date: Fri, 21 Sep 2012 08:42:09 -0700 (PDT)
Local: Fri, Sep 21 2012 11:42 am
Subject: Re: Possible redis bug?

Using 2.4.17 at least solved the expiration problem.

However, I've observed another issue with 2.4.17.

I have maxmemory set to 256M. However, I've seen the log showed that redis
used the memory
proportional to the number of clients (each might be writing updating the
same key).  There are only
3 keys used for this cache, total memory for these should be around 75M.
And occationally, i get ERR memory
exceeding maxmemory, but not always.

So my question is:
what's maxmemory? how is it observed? and how can total memory used be
bigger than maxmemory?

[14749] 21 Sep 11:34:31 - DB 0: 2 keys (0 volatile) in 4 slots HT.
[14749] 21 Sep 11:34:31 - 17 clients connected (0 slaves), 554518168 bytes
in use
[14749] 21 Sep 11:34:36 - DB 0: 2 keys (0 volatile) in 4 slots HT.
[14749] 21 Sep 11:34:36 - 17 clients connected (0 slaves), 638404152 bytes
in use
[14749] 21 Sep 11:34:41 - DB 0: 2 keys (0 volatile) in 4 slots HT.
[14749] 21 Sep 11:34:41 - 17 clients connected (0 slaves), 667764216 bytes
in use
[14749] 21 Sep 11:34:46 - DB 0: 2 keys (0 volatile) in 4 slots HT.
[14749] 21 Sep 11:34:46 - 17 clients connected (0 slaves), 667764176 bytes
in use
[14749] 21 Sep 11:34:51 - DB 0: 2 keys (0 volatile) in 4 slots HT.
[14749] 21 Sep 11:34:51 - 17 clients connected (0 slaves), 667764144 bytes
in use
[14749] 21 Sep 11:34:56 - DB 0: 2 keys (0 volatile) in 4 slots HT.
[14749] 21 Sep 11:34:56 - 17 clients connected (0 slaves), 667764144 bytes
in use
[14749] 21 Sep 11:35:01 - DB 0: 2 keys (0 volatile) in 4 slots HT.
[14749] 21 Sep 11:35:01 - 17 clients connected (0 slaves), 667764144 bytes
in use
[14749] 21 Sep 11:35:06 - DB 0: 2 keys (0 volatile) in 4 slots HT.
[14749] 21 Sep 11:35:06 - 16 clients connected (0 slaves), 630006888 bytes
in use
[14749] 21 Sep 11:35:11 - DB 0: 2 keys (0 volatile) in 4 slots HT.
[14749] 21 Sep 11:35:11 - 13 clients connected (0 slaves), 516735128 bytes
in use
[14749] 21 Sep 11:35:16 - DB 0: 2 keys (0 volatile) in 4 slots HT.
[14749] 21 Sep 11:35:16 - 12 clients connected (0 slaves), 478977856 bytes
in use
[14749] 21 Sep 11:35:21 - DB 0: 2 keys (0 volatile) in 4 slots HT.
[14749] 21 Sep 11:35:21 - 10 clients connected (0 slaves), 403463328 bytes
in use
[14749] 21 Sep 11:35:26 - DB 0: 2 keys (0 volatile) in 4 slots HT.
[14749] 21 Sep 11:35:26 - 9 clients connected (0 slaves), 365706072 bytes
in use
[14749] 21 Sep 11:35:31 - DB 0: 2 keys (0 volatile) in 4 slots HT.
[14749] 21 Sep 11:35:31 - 9 clients connected (0 slaves), 365706064 bytes
in use
[14749] 21 Sep 11:35:36 - DB 0: 2 keys (0 volatile) in 4 slots HT.
[14749] 21 Sep 11:35:36 - 8 clients connected (0 slaves), 327948848 bytes
in use
[14749] 21 Sep 11:35:41 - DB 0: 2 keys (0 volatile) in 4 slots HT.
[14749] 21 Sep 11:35:41 - 8 clients connected (0 slaves), 327948848 bytes
in use
[14749] 21 Sep 11:35:46 - DB 0: 2 keys (0 volatile) in 4 slots HT.
[14749] 21 Sep 11:35:46 - 8 clients connected (0 slaves), 327948840 bytes
in use
[14749] 21 Sep 11:35:51 - DB 0: 2 keys (0 volatile) in 4 slots HT.
[14749] 21 Sep 11:35:51 - 7 clients connected (0 slaves), 290191560 bytes
in use
[14749] 21 Sep 11:35:56 - DB 0: 2 keys (0 volatile) in 4 slots HT.
[14749] 21 Sep 11:35:56 - 6 clients connected (0 slaves), 252434280 bytes
in use
[14749] 21 Sep 11:36:01 - DB 0: 2 keys (0 volatile) in 4 slots HT.
[14749] 21 Sep 11:36:01 - 6 clients connected (0 slaves), 252434304 bytes
in use
[14749] 21 Sep 11:36:06 - DB 0: 2 keys (0 volatile) in 4 slots HT.
[14749] 21 Sep 11:36:06 - 6 clients connected (0 slaves), 252434304 bytes
in use
[14749] 21 Sep 11:36:11 - DB 0: 2 keys (0 volatile) in 4 slots HT.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Josiah Carlson  
View profile  
 More options Sep 21 2012, 12:05 pm
From: Josiah Carlson <josiah.carl...@gmail.com>
Date: Fri, 21 Sep 2012 09:05:37 -0700
Local: Fri, Sep 21 2012 12:05 pm
Subject: Re: Possible redis bug?
If your clients are using that much memory, then they likely either
have very large outgoing buffers associated with them, or had very
large outgoing buffers associated with them in the past that were not
released.

Can you check INFO and CLIENT LIST output? That may tell us if it is
related to outgoing buffers, or previous outgoing buffers.

 - Josiah


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
zs  
View profile  
 More options Sep 21 2012, 12:12 pm
From: zs <zsl...@gmail.com>
Date: Fri, 21 Sep 2012 09:12:07 -0700 (PDT)
Local: Fri, Sep 21 2012 12:12 pm
Subject: Re: Possible redis bug?

here is the output of info:

redis_version:2.4.17
redis_git_sha1:00000000
redis_git_dirty:0
arch_bits:64
multiplexing_api:epoll
gcc_version:4.1.2
process_id:14749
run_id:4ae6f29c8b9a38b15b77c9998cb93090efc2b53b
uptime_in_seconds:172217
uptime_in_days:1
lru_clock:606641
used_cpu_sys:201.53
used_cpu_user:121.91
used_cpu_sys_children:2.73
used_cpu_user_children:14.85
connected_clients:1
connected_slaves:0
client_longest_output_list:0
client_biggest_input_buf:0
blocked_clients:0
used_memory:63648160
used_memory_human:60.70M
used_memory_rss:62668800
used_memory_peak:743278872
used_memory_peak_human:708.85M
mem_fragmentation_ratio:0.98
mem_allocator:jemalloc-3.0.0
loading:0
aof_enabled:0
changes_since_last_save:5
bgsave_in_progress:0
last_save_time:1348243230
bgrewriteaof_in_progress:0
total_connections_received:2918
total_commands_processed:12261
expired_keys:49
evicted_keys:141
keyspace_hits:2771
keyspace_misses:1189
pubsub_channels:0
pubsub_patterns:0
latest_fork_usec:7307
vm_enabled:0
role:master
db0:keys=3,expires=1

CLIENT LIST show a bunch of
fd=8 idle=9 flags=N db=0 sub=0 psub=0 qbuf=0 obl=0 oll=0 events=r cmd=get

not sure how to read them


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Josiah Carlson  
View profile  
 More options Sep 21 2012, 1:20 pm
From: Josiah Carlson <josiah.carl...@gmail.com>
Date: Fri, 21 Sep 2012 10:19:56 -0700
Local: Fri, Sep 21 2012 1:19 pm
Subject: Re: Possible redis bug?
I'm sorry I wasn't more explicit.

The information is really only useful when your server is having the
issue. From the INFO output, you only seem to have 1 client... yet you
have many lines from CLIENT LIST? That seems strange...

But specifically, CLIENT LIST shows lines with "oll=" information,
that is the length of the output buffer list in items. Redis 2.6 gives
you the actual bytes used, but knowing the number of items in the
output buffer is a good start for 2.4 .

Regards,
 - Josiah


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
c.z  
View profile  
 More options Sep 21 2012, 3:03 pm
From: "c.z" <c...@rocketfuelinc.com>
Date: Fri, 21 Sep 2012 12:03:21 -0700 (PDT)
Local: Fri, Sep 21 2012 3:03 pm
Subject: Re: Possible redis bug?

I did a bunch of CLIENT LIST calls.

I see up to 30 clients, but all most all of them have 0 (the same output i
pasted).

I did on two instances where I see qbuff = 6047336 and qbuf = 1779140.

My two keys are of size 25M and 35M, and those are the only two keys I use.
Clients
either get or set on these keys.

The info command showed that we have used up to 500M, how could that happen?

redis_version:2.4.17redis_git_sha1:00000000redis_git_dirty:0arch_bits:64mul tiplexing_api:epoll
gcc_version:4.1.2process_id:14749run_id:4ae6f29c8b9a38b15b77c9998cb93090efc 2b53buptime_in_seconds:182677uptime_in_days:2lru_clock:607687used_cpu_sys:2 41.47used_cpu_user:145.08used_cpu_sys_children:3.29used_cpu_user_children:1 7.65connected_clients:16connected_slaves:0client_longest_output_list:0clien t_biggest_input_buf:20015164blocked_clients:0used_memory:520955400used_memo ry_human:496.82Mused_memory_rss:494592000used_memory_peak:743278872used_mem ory_peak_human:708.85Mmem_fragmentation_ratio:0.95mem_allocator:jemalloc-3. 0.0loading:0aof_enabled:0changes_since_last_save:9bgsave_in_progress:0last_ save_time:1348253731bgrewriteaof_in_progress:0total_connections_received:34 37
total_commands_processed:14899expired_keys:57evicted_keys:162keyspace_hits: 3477keyspace_misses:1400pubsub_channels:0
pubsub_patterns:0
latest_fork_usec:8873
vm_enabled:0
role:master
db0:keys=2,expires=0

...

read more »


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Josiah Carlson  
View profile  
 More options Sep 23 2012, 10:56 am
From: Josiah Carlson <josiah.carl...@gmail.com>
Date: Sun, 23 Sep 2012 07:56:41 -0700
Local: Sun, Sep 23 2012 10:56 am
Subject: Re: Possible redis bug?
Wait...

You have 2 keys in your database. One is 25 megabytes, the other is 35
megabytes. And all you are doing is reading and writing those two
values?

Your memory use is caused by one of three things:
1. incoming buffers
2. outgoing buffers
3. memory fragmentation

Aside from changing your access patterns (breaking your data up into
smaller pieces that *won't* lead to fragmentation), forcing Redis to
pre-allocate fixed-size blocks for big allocations like this to
prevent fragmentation when you SET/GET values, or a few other things,
I am out of "simple" solutions.

More specifically, you have access patterns that the current memory
allocator (and Redis) was not designed to handle. I'm not surprised
that you're having a bad time.

If you can explain the problem you are attempting to solve, we might
be able to offer a better solution that doesn't involve these
operations, that would give you better memory behavior.

Regards,
 - Josiah

...

read more »


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
c.z  
View profile  
 More options Sep 23 2012, 9:23 pm
From: "c.z" <c...@rocketfuelinc.com>
Date: Sun, 23 Sep 2012 18:23:07 -0700 (PDT)
Local: Sun, Sep 23 2012 9:23 pm
Subject: Re: Possible redis bug?

The use case is to cache a couple of big data structure.

I can use compression to reduce the size of the data, but is that the real
problem? redis documents says that value can be 512M.

The other thing is that one of the key (with 35M-length value) has a
expiry. I know expiry didn't quite work in 2.4.4, could there be a problem
with 2.4.17 as well? (i.e., key expired, but memory didn't really get
de-allocated?).

How do you avoid memory fragmentation? (mem_fragmentation_ratio:0.98, does
it mean that it's 98percent fragmented?)

...

read more »


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Josiah Carlson  
View profile  
 More options Sep 24 2012, 12:52 am
From: Josiah Carlson <josiah.carl...@gmail.com>
Date: Sun, 23 Sep 2012 21:52:16 -0700
Local: Mon, Sep 24 2012 12:52 am
Subject: Re: Possible redis bug?

On Sun, Sep 23, 2012 at 6:23 PM, c.z <c...@rocketfuelinc.com> wrote:
> The use case is to cache a couple of big data structure.

Does the entire structure change every time it is written? Only a
small part? Can you encode the changes as a series of deltas, which
are rolled up occasionally?

> I can use compression to reduce the size of the data, but is that the real
> problem? redis documents says that value can be 512M.

*Can be* is not the same as *should be*.

Redis is limited by what the underlying memory allocator is able to
do. Redis currently uses Jemalloc, which does a few things to
reduce/minimize memory fragmentation, and which has solved the issue
for the majority of use-cases. But your particular use-case seems like
it is stressing the memory allocator in ways that it wasn't intended
(a few large allocations that are repeated and freed).

> The other thing is that one of the key (with 35M-length value) has a expiry.
> I know expiry didn't quite work in 2.4.4, could there be a problem with
> 2.4.17 as well? (i.e., key expired, but memory didn't really get
> de-allocated?).

When data "expires" in Redis, it is not an active expiration. That is,
if a key passes expiration, that doesn't mean it is immediately
deallocated. Typically, Redis will make a handful of random probes to
clean out a few keys if it finds any that should be expired. If too
many are found, it performs a scan to clean out as many expired keys
as possible.

Looking at your most recent INFO output:
db0:keys=2,expires=0

You don't have any keys that should be expired.

That said, if you only have a few keys, they should be expired almost
as though they were actively expired (unless I'm missing something).

> How do you avoid memory fragmentation? (mem_fragmentation_ratio:0.98, does
> it mean that it's 98percent fragmented?)

No. 1.0 means that Redis is using exactly as much memory as is
expected. < 1.0 means that it is using less memory than is expected. >
1.0 means it is using more.  If you are seeing < 1.0, that is usually
a sign of a bug somewhere. Typical fragmentation ratios with the
current jemalloc allocator are usually in the 1.0 to 1.15 range, which
means up to 15% memory is used that is not accounted for in other
parts.

Also, "memory fragmentation ratio" is an attempt to measure an issue
that occurs in all processes that run on computers, specifically a
combination of "internal fragmentation" and "external fragmentation"
as described: http://en.wikipedia.org/wiki/Fragmentation_(computing) .
Though the ratio that is calculated by Redis is different than the
description on the wikipedia page.

Regards,
 - Josiah

...

read more »


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
c.z  
View profile  
 More options Sep 24 2012, 1:11 pm
From: "c.z" <c...@rocketfuelinc.com>
Date: Mon, 24 Sep 2012 10:11:53 -0700 (PDT)
Local: Mon, Sep 24 2012 1:11 pm
Subject: Re: Possible redis bug?

>That said, if you only have a few keys, they should be expired almost
> as though they were actively expired (unless I'm missing something).

by 'actively expired', do you mean that the client should delete the keys
itself?

expired_keys:103
evicted_keys:1040
keyspace_hits:10368
keyspace_misses:33897

showed that keys did get expired. But based on your explanation, it might
be possible that key-value
stays in memory for a much longer period, as they don't get removed right
away...


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Josiah Carlson  
View profile  
 More options Sep 24 2012, 1:35 pm
From: Josiah Carlson <josiah.carl...@gmail.com>
Date: Mon, 24 Sep 2012 10:35:49 -0700
Local: Mon, Sep 24 2012 1:35 pm
Subject: Re: Possible redis bug?

On Mon, Sep 24, 2012 at 10:11 AM, c.z <c...@rocketfuelinc.com> wrote:

>>That said, if you only have a few keys, they should be expired almost
>> as though they were actively expired (unless I'm missing something).

> by 'actively expired', do you mean that the client should delete the keys
> itself?

Some systems with expiration keep a priority queue of items to be
expired. Redis doesn't. Redis will randomly check keys to be expired,
and expire them.

> expired_keys:103
> evicted_keys:1040
> keyspace_hits:10368
> keyspace_misses:33897

> showed that keys did get expired. But based on your explanation, it might be
> possible that key-value
> stays in memory for a much longer period, as they don't get removed right
> away...

That is not the case. It is either fragmentation, or it might be kept
around to finish the transfer to clients that requested it before it
had expired (especially for slow clients).

 - Josiah


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dcshi  
View profile  
 More options Oct 1 2012, 4:32 am
From: Dcshi <alohad...@gmail.com>
Date: Mon, 1 Oct 2012 16:32:57 +0800
Local: Mon, Oct 1 2012 4:32 am
Subject: Re: Possible redis bug?

发自我的 iPad

在 2012-9-22,上午3:03,"c.z" <c...@rocketfuelinc.com> 写道:

...

read more »


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »