Skip to content

redis 内存分析 #192

Description

@shenkonghui

查看容器使用内存1.6G

NAME                                                CPU(cores)   MEMORY(bytes)
redis-s-redis-single-6d9fcf76d9-bkv9h               4m           1624Mi

实际在pod中top查看内存使用了1个G,即设置的redis maxmemory参数

top - 16:22:12 up 7 days,  1:11,  0 users,  load average: 6.37, 5.83, 6.05
Tasks:   7 total,   1 running,   6 sleeping,   0 stopped,   0 zombie
%Cpu(s): 40.6 us, 26.4 sy,  0.0 ni, 30.2 id,  0.2 wa,  0.0 hi,  2.6 si,  0.0 st
MiB Mem :  11854.8 total,    228.5 free,   5948.5 used,   5677.7 buff/cache
MiB Swap:      0.0 total,      0.0 free,      0.0 used.   4866.9 avail Mem

   PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND
     1 root      20   0 1246092   1.0g   1840 S   0.0   8.7   1:55.58 redis-server

回收pagecache后

echo 1 > /proc/sys/vm/drop_caches

NAME                                                CPU(cores)   MEMORY(bytes)
redis-s-redis-single-6d9fcf76d9-bkv9h               4m           1036Mi

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions