Skip to content

slave memory leaks unexpected #1063

Closed
Closed

Description

@ranweisky

our redis has one master and two slaves. master is used for writing and slaves for read
the load of two slaves are not balanced.
one of the slaves shows memery increasion and reaches 64G in nearly one week
is it a known issue?

info as below:
redis_version:2.4.17
redis_git_sha1:00000000
redis_git_dirty:0
arch_bits:64
multiplexing_api:epoll
gcc_version:3.4.5
process_id:12810
run_id:4572562df85e606f2b104c91a4f12d384aa442dd
uptime_in_seconds:935738
uptime_in_days:10
lru_clock:320363
used_cpu_sys:15491.18
used_cpu_user:40038.00
used_cpu_sys_children:1145.14
used_cpu_user_children:6828.54
connected_clients:144
connected_slaves:0
client_longest_output_list:1002795
client_biggest_input_buf:0
blocked_clients:0
used_memory:30112603920
used_memory_human:28.04G
used_memory_rss:27719020544
used_memory_peak:30112857704
used_memory_peak_human:28.04G
mem_fragmentation_ratio:0.92
mem_allocator:jemalloc-3.0.0
loading:0
aof_enabled:1
changes_since_last_save:5279
bgsave_in_progress:0
last_save_time:1366352293
bgrewriteaof_in_progress:0
total_connections_received:1157
total_commands_processed:1405498323
expired_keys:0
evicted_keys:0
keyspace_hits:1354193664
keyspace_misses:25036293
pubsub_channels:0
pubsub_patterns:0
latest_fork_usec:365363
vm_enabled:0
role:slave
aof_current_size:1160106744
aof_base_size:66
aof_pending_rewrite:0
aof_buffer_length:0
aof_pending_bio_fsync:0
master_host:10.36.72.40
master_port:8615
master_link_status:up
master_last_io_seconds_ago:0
master_sync_in_progress:0
slave_priority:100
db0:keys=1166985,expires=2
aof_global_offset:6324984906
sync_delay_mstime:4
server_version:1

Activity

  1. ranweisky commented on Apr 19, 2013

    @ranweisky
    Author

    the number of client_longest_output_list is very large in this slave while it's 0 in the other one

  2. antirez commented on Apr 19, 2013

    @antirez
    Contributor

    Yes the client_longest_output_list is the problem.

    Looks like there is one client that is not reading back what the server sends, please could you run CLIENT LIST and send the output here? Thanks.

    With Redis 2.6 you can configure output buffer limits for different classes of clients, so that Redis will automatically drop the connection.

    Are you using Pub/Sub?

  3. ranweisky commented on Apr 20, 2013

    @ranweisky
    Author

    yeah... client list shows two clients has long oll,

    addr=x.x.x.x:x fd=41 idle=4 flags=N db=0 sub=0 psub=0 qbuf=0 obj=0 oll=1010684 events=rw cmd=lindex
    addr=x.x.x.x:x fd=44 idle=0 flags=N db=0 sub=0 psub=0 qbuf=0 obj=0 oll=1005451 events=rw cmd=get

    not using Pub/Sub... will there be any other possible root cause? like executing a slow query?

  4. antirez commented on Apr 20, 2013

    @antirez
    Contributor

    Not related to slow queries, are you using a non-blocking client? It looks like there are queries sent but never "consumed" by the client.

  5. ranweisky commented on Apr 22, 2013

    @ranweisky
    Author

    "Consume"... uh.. do u mean the client sent a request to redis, but didn't get the result back? i'm using php redis extention and use pconnect

  6. antirez commented on Apr 22, 2013

    @antirez
    Contributor

    Yes that's my guess, that for some reason queries are sent but replies not consumed.
    I guess that pconnect may be the culprit in some way or the other.

  7. ranweisky commented on Apr 22, 2013

    @ranweisky
    Author

    u guys are really cool.. i appreciate that

  8. ranweisky commented on Apr 22, 2013

    @ranweisky
    Author

    so may i avoid this issue by using phpredis connect instead of pconnect? if i won't find out the criminal client logic...

  9. added a commit that references this issue on Oct 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions