简体   繁体   English

关于CouchDB的内存消耗

[英]Regarding Memory Consumption of CouchDB

I did some evaluations on CouchDB recently.我最近在 CouchDB 上做了一些评估。 I found that memory consumption is pretty high for view construction (map & reduce) as well as importing a larger JSON document into CouchDB.我发现视图构建(映射和缩减)以及将更大的 JSON 文档导入 CouchDB 的内存消耗非常高。 I evaluated the view construction function on a Ubuntu system (4 cores, Intel® Xeon® CPU E3-1240 v5 @ 3.50GHz).我在 Ubuntu 系统(4 核,Intel® Xeon® CPU E3-1240 v5 @ 3.50GHz)上评估了视图构建功能。 Here are the results:结果如下:

  1. four hundred 100KB datasets would cost around 683 MB memory;四百个 100KB 的数据集将花费大约 683 MB 的内存;
  2. one 80 MB dataset would cost around 2.5 GB memory;一个 80 MB 的数据集将花费大约 2.5 GB 的内存;
  3. four 80 MB datasets would cost around 10 GB memory.四个 80 MB 的数据集将花费大约 10 GB 的内存。

It seems that memory consumption is hundreds of times of original JSON dataset.内存消耗似乎是原始 JSON 数据集的数百倍。 If we use 1 GB dataset, then CouchDB would run out of the memory.如果我们使用 1 GB 数据集,那么 CouchDB 将耗尽内存。 Does anyone know the reason why memory consumption is so huge?有谁知道内存消耗如此巨大的原因? Many thanks!非常感谢!

I don't know why the memory is so high, but I know it's consistent with CouchDB and you can't really get around it as long as you have large document sizes.我不知道为什么内存这么高,但我知道它与 CouchDB 是一致的,只要你有很大的文档大小,你就无法真正绕过它。 I eventually split out the data that I wanted to build views on and then kept the full documents in a separate database for later extraction.我最终拆分出我想要构建视图的数据,然后将完整文档保存在一个单独的数据库中以供以后提取。

I know that late to answer but I'll leave this answer for someone to benefit.我知道回答晚了,但我会留下这个答案让某人受益。 Actually, it's about the caching responses.实际上,这是关于缓存响应。 Couchdb wants to cache the responses to return the results faster. Couchdb 希望缓存响应以更快地返回结果。 You can handle the issue by setting the caching limits.您可以通过设置缓存限制来处理该问题。

Check it: https://docs.couchdb.org/en/latest/config/couchdb.html检查它: https : //docs.couchdb.org/en/latest/config/couchdb.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM