Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OOM on the mbuf freelist (100+GB) #538

Open
inter169 opened this issue Oct 2, 2017 · 4 comments
Open

OOM on the mbuf freelist (100+GB) #538

inter169 opened this issue Oct 2, 2017 · 4 comments

Comments

@inter169
Copy link

inter169 commented Oct 2, 2017

the nutcracker process consumed 100+GB phisycal memory on my production box after a data migration from another redis to this one (nutcracker).
and the gdb console showed below:

(gdb) p nfree_mbufq
$1 = 6365614
(gdb) p mbuf_chunk_size
$1 = 16384

the memory consumption was nfree_mbufq * mbuf_chunk_size = 101GB approx.
I have read some code fixes (pr)s about the similar phenomenon, like:
#461
#203

but such fixes didn't set the limitation of the mbuf chunks, so the OOM was still here,
I coded a fix, and the nutcracker can pass a command param ('-n ', in my fix) to set the max number of mbuf chunks, once exceeded the limitation it can free the mbuf after processing one req immediately.

@gauxs
Copy link

gauxs commented Feb 17, 2019

Hi, can you share your fix. I am facing the same issue.

@inter169
Copy link
Author

I mergerd the code fix onto my repo:
inter169@2b2a0d0

@yongman
Copy link

yongman commented Apr 25, 2019

@inter169 Memory can not be freed after even free all mbufs but free msgs together in my test. I think the reason is syscall brk in malloc can not free memory fragment to os.

@TysonAndre
Copy link
Collaborator

#486 was merged in 2016 so 461 isn't relevant.

I'd agree that some sort of memory limit would make sense, and that mbufs aren't freed

During pathological networking situations (e.g. limited bandwidth, extremely high timeouts and high traffic) high memory usage can be a problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants