maxmemory not reducing after flushall

113 views
Skip to first unread message

Birdy

unread,
Aug 22, 2012, 10:36:06 AM8/22/12
to redi...@googlegroups.com
Hi All,

I am using redis version 2.4.4 on Oracle Enterprise Linux 5.8.
I have set maxmemory setting to 4.0GB. When my application tried to insert data  > 4.0GB data it started throwing maxmemory reached exception as expected. 
Then I executed 'FLUSHALL' command from redis client console to clear all datasets. when I checked info command it still shows "used_memory_rss:3319943168".

I have checked issue 654 which is similar to this one. I have following queries:
1. If such a client disconnects its socket connection, Will it clean the redis-memory(Output buffer) then? (In our driver/client we disconnect the socket connection when we observe any issue and open a new socket connection with server. Thats why i asked this question)
2. Can we know the port number of such a client??
3. Also Can we flush client output buffer somehow??

Thanks,
Anurag Berdia

Didier Spezia

unread,
Aug 22, 2012, 11:17:22 AM8/22/12
to redi...@googlegroups.com

>> when I checked info command it still shows "used_memory_rss:3319943168".

Well this is just the way most memory allocators work. Redis frees the memory,
but the memory allocator does not give the memory back to the system, that's why
the RSS remains high.

>> 1. If such a client disconnects its socket connection, Will it clean the redis-memory(Output buffer) then?

Yes ... but this is probably unrelated to your problem.

>> 2. Can we know the port number of such a client??

You can use the CLIENT LIST command for that.

>> 3. Also Can we flush client output buffer somehow??

Without closing the connection, I think it is not possible.
But again, this is probably unrelated to your problem.

Regards,
Didier.

Birdy

unread,
Aug 22, 2012, 11:34:12 AM8/22/12
to redi...@googlegroups.com
Hi Didier,
Thanks for quick reply.

I am also attaching the redis-cli output of before and after flushing.
Why I asked those questions because the redis-cli info shows this parameter: client_longest_output_list:346370. And also because of  issue-654.

Can you check redis-cli info output attached with the post?

T&R,
Anurag Berdia
redis_info_220812.txt

Josiah Carlson

unread,
Aug 22, 2012, 12:43:20 PM8/22/12
to redi...@googlegroups.com
Can you give us the output of "CLIENT LIST"?

- Josiah
> --
> You received this message because you are subscribed to the Google Groups
> "Redis DB" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/redis-db/-/SlnyoSSlR-kJ.
>
> To post to this group, send email to redi...@googlegroups.com.
> To unsubscribe from this group, send email to
> redis-db+u...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/redis-db?hl=en.

Birdy

unread,
Aug 23, 2012, 3:09:41 AM8/23/12
to redi...@googlegroups.com
Hi Josiah,

Unfortunately, we do not have output of "Client List" of that time. We are using 1 master and 1 slave. And we are not using any disk dumping. (No snapshotting or append-only file)
I did some testing with redis and got answer for one of my questions:

1. If such a client disconnects its socket connection, Will it clean the redis-memory(Output buffer) then? (In our driver/client we disconnect the socket connection when we observe any issue and open a new socket connection with server. Thats why i asked this question)
>> If such a client disconnects its socket connection then redis will clean its output buffers for that client. 
(Our driver/redis-client does disconnect socket when it observes any issue and open a new one. So it is not clear to me why so much data was in output buffers)

And still two things are not clear to me::
2. Can we know the port number of such a client? (Who is using a lot of output buffer)
3. Can we flush client output buffer somehow??

T&R,
Anurag Berdia

Jokea

unread,
Aug 23, 2012, 5:17:59 AM8/23/12
to redi...@googlegroups.com
Didier has already answered your questions.
Use CLIENT LIST to get a list of clients, you will also get the length
of each client's output buffer,
use CLIENT KILL ip:port to force close connection with that client.


Regards,
Jokea

Birdy

unread,
Aug 23, 2012, 6:05:16 AM8/23/12
to redi...@googlegroups.com
Thanks for pointing it out Jokea.. Now it is clear to me..
The only concern I am left with: 
"Why redis-client didn't read the output buffer. If a problem occurs in redis-client i am using, it closes existing socket connection and opens a new one."
If this works correctly then redis-server should have cleaned the output buffers. 
I will do more test cases and let you guys know. 

T&R,
Anurag Berdia
Reply all
Reply to author
Forward
0 new messages