Skip to Content
MongoDB权威指南(第3版)
book

MongoDB权威指南(第3版)

by Shannon Bradshaw, Eoin Brazil, Kristina Chodorow
November 2021
Intermediate to advanced
410 pages
12h 1m
Chinese
Posts & Telecom Press
Content preview from MongoDB权威指南(第3版)
354
22
一些工作集的例子
假设有一个
40GB
的工作集。总共有
90%
的请求能够命中工作集,而
10%
的请求会命中
其他数据。如果有
500GB
的数据和
50GB
RAM
,那么工作集可以完全放入
RAM
中。
一旦应用程序访问了通常需要访问的数据(此过程称为
预热
),那么就不需要在访问工作
集时再次访问磁盘了。然后,它还有
10GB
的可用空间用于
460GB
较少被访问的数据
。显
然,
MongoDB
大多数情况下需要到磁盘上获取那些非工作集数据。
另外,假设工作集不能被放入
RAM
(比如,你只有
35GB
RAM
),那么工作集通常
会占用大部分
RAM
。工作集驻留在
RAM
中的可能性更高
,因为它被访问的频率更高,但
在某些时候,访问频率较低的数据也会被加载进内存中,从而将工作集(或其他访问频率
较低的数据)“驱逐”出内存。因此,会不断发生同磁盘的数据交换:访问工作集不再具
有可预测的性能。
22.3
 跟踪性能情况
跟踪查询的性能并使其保持稳定通常很重要。有几种方式可以跟踪
MongoDB
是否能够承
受当前的请求负载。
对于
MongoDB
说,
CPU
的大部分占用时间和
I/O
相关(表现为很高的
I/O
等待)。
WiredTiger
存储引擎是多线程的
,可以利用额外的
CPU
核。与旧的
MMAP
存储引擎相比,
这可以从更高的
CPU
使用量指标中看出
。然而,如果用户或系统时间接近
100%
(或者
100%
乘以
CPU
数量)
,那么最常见的原因是缺少了某个常用查询的索引。跟踪
CPU
使用
情况是一个很好的方法(特别是在部署了应用程序的新版本之后),这样可以确保所有查 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

大数据项目管理:从规划到实现

大数据项目管理:从规划到实现

Ted Malaska, Jonathan Seidman
Go程序设计语言

Go程序设计语言

艾伦A. A.多诺万, 布莱恩W. 柯尼汉
Spark快速大数据分析(第2版)

Spark快速大数据分析(第2版)

Jules S. Damji, Brooke Wenig, Tathagata Das, Denny Lee
Kafka权威指南(第2版)

Kafka权威指南(第2版)

Gwen Shapira, Todd Palino, Rajini Sivaram, Krit Petty

Publisher Resources

ISBN: 9787115576538