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

如何限制内存占用 #423

Open
mysunnyshine opened this issue Nov 16, 2019 · 3 comments
Open

如何限制内存占用 #423

mysunnyshine opened this issue Nov 16, 2019 · 3 comments

Comments

@mysunnyshine
Copy link

我们的业务场景要求,必须有效的限制内存。我改了RocksDB的配置,将buffer改小。 测试发现,内存占用还是1.5G左右,期望控制在1G内。 这个具体有哪些参数可以调节,能分享下经验么?

@qinzuoyan
Copy link
Contributor

请问你微信号多少?我把你拉群讨论吧

@mysunnyshine
Copy link
Author

请问你微信号多少?我把你拉群讨论吧

已经在群里了,二群。问了,也没有人回复,只好在这里问了。
主要就是目前期望能控制 Pegasus 占用的内存,不希望他随着数据量的增加,内存也增加。

@Smityz
Copy link
Contributor

Smityz commented Aug 27, 2021

1G 内存过于严苛了,rocksdb 的运行时占用都可能不止 1G
你可以考虑

  1. 把 rocksdb 的 blockcache 关掉,并参考 https://github.com/facebook/rocksdb/wiki/Memory-usage-in-RocksDB 这个页面把所有对内存有影响的参数调低。
  2. 单机分片数尽可能少,降低 rocksdb 实例个数
  3. 使用新版本(v2.2 以上)的 pegasus,我们做了不少关于内存使用的优化

这是 Onebox 场景下使用 valgrind massif 查看内存分布的用量图,可以看出,大部分内存还是由 rocksdb 产生的
image

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

3 participants