TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

MongoMem: Memory usage by collection in MongoDB

33 点作者 rgarcia大约 11 年前

2 条评论

fiatmoney大约 11 年前
Mongo&#x27;s internal storage mechanisms are a mess. BSON is incredibly inefficient as a storage format (for instance, it stores arrays as string -&gt; string maps with a literal index, ie [&quot;1&quot; &quot;first element&quot; &quot;2&quot; &quot;second element&quot;]), it relies on mmap &#x2F; fsync for read &#x2F; write scheduling (see [1] for some issues specifically with regards to database usage), and its &quot;linked list of documents&quot; approach means that any appreciable number of removals or updates badly fragments your storage space. Oh, and key names aren&#x27;t interned, so better use the first N unicode characters rather than sensible names if you need to fit everything into the page cache (and due to the lack of caching algorithms beyond the OS&#x27;s LRU-by-page, you definitely need to fit everything into the page cache). &quot;Everything&quot; really means &quot;both data <i>and indexes</i>&quot; since the OS doesn&#x27;t know the difference between your index &amp; data - it will quite happily evict index entries from cache in favor of a data scan.<p>[1] <a href="http://rhaas.blogspot.co.uk/2014/03/linuxs-fsync-woes-are-getting-some.html" rel="nofollow">http:&#x2F;&#x2F;rhaas.blogspot.co.uk&#x2F;2014&#x2F;03&#x2F;linuxs-fsync-woes-are-ge...</a>
评论 #7699154 未加载
评论 #7695839 未加载
caio1982大约 11 年前
I&#x27;m so going to use it. Thanks for open sourcing it!
评论 #7699487 未加载