Des*_*ess 5 mongodb ubuntu wiredtiger mongodb-3.2
我将MongoDB (3.2.6)其用作我的应用程序的存储,因为几周后 MongoDB 通常每 1 或 2 周就开始崩溃。崩溃似乎来自WiredTiger内存分配期间的问题,这里是stacktrace上次崩溃的全部内容:
2016-10-09T18:25:36.389+0200 E STORAGE [thread1] WiredTiger (12) [1476030336:325695][993:0x7f559c19a700], file:index-1108-8065571460375661294.wt, WT_SESSION.checkpoint: memory allocation of 18624 bytes failed: Cannot allocate memory
2016-10-09T18:25:36.547+0200 E STORAGE [thread1] WiredTiger (12) [1476030336:422567][993:0x7f559c19a700], file:index-1108-8065571460375661294.wt, WT_SESSION.checkpoint: checkpoints cannot be dropped when in-use: Cannot allocate memory
2016-10-09T18:25:37.347+0200 I COMMAND [conn10793] command admin.$cmd command: ping { ping: 1 } keyUpdates:0 writeConflicts:0 numYields:0 reslen:37 locks:{} protocol:op_query 208ms
2016-10-09T18:25:37.386+0200 E STORAGE [thread1] WiredTiger (12) [1476030337:254969][993:0x7f559c19a700], checkpoint-server: checkpoint server error: Cannot allocate memory
2016-10-09T18:25:38.448+0200 E STORAGE [thread1] WiredTiger (-31804) [1476030337:484838][993:0x7f559c19a700], checkpoint-server: the process must exit and restart: WT_PANIC: WiredTiger library panic
2016-10-09T18:25:38.677+0200 I - [conn10894] Fatal Assertion 28559
2016-10-09T18:25:38.994+0200 I - [WTJournalFlusher] Fatal Assertion 28559
2016-10-09T18:25:38.994+0200 I - [TTLMonitor] Fatal Assertion 28559
2016-10-09T18:25:40.978+0200 I - [thread1] Fatal Assertion 28558
2016-10-09T18:25:41.207+0200 I - [thread1]
Run Code Online (Sandbox Code Playgroud)
它运行的服务器有 7Gb RAM,专门用于 Mongo。
free -m
total used free shared buffers cached
Mem: 6811 6140 670 0 28 634
-/+ buffers/cache: 5478 1332
Swap: 2047 1009 1038
Run Code Online (Sandbox Code Playgroud)
几个数据库正在运行,总大小约为 925MB,而 WiredTiger 缓存状态为:
db.serverStatus().wiredTiger.cache
"bytes currently in the cache" : 969927022,
"bytes read into cache" : 800513540,
"bytes written from cache" : 1349774879,
"maximum bytes configured" : 3221225472,
[...]
Run Code Online (Sandbox Code Playgroud)
根据文档,WiredTiger 应该默认使用
60% 的 RAM 减去 1 GB,或 [...] https://docs.mongodb.com/manual/faq/storage/#to-what-size-should-i-set-the-wiredtiger-cache
基于7GB RAM我们得到 ~ 3.2Gb 所以它看起来不错。
现在 925Mb 的数据库如何能破坏 3.2Gb 的缓存?我知道我们必须考虑索引,但即使通过索引每个字段(事实并非如此),它也不应该填充剩余的 2+ Gb?上次崩溃发生在昨天,因此提供的统计数据只是在重新启动之后。难道是我使用 Mongo 的方式在缓慢增加内存消耗的某处发生了内存泄漏?我可能完全错过了这一点,因为我是 Mongo 的新手,所以任何领先的建议或文章都会让我松一口气。
我发现了这个问题:https : //jira.mongodb.org/browse/SERVER-24408但它没有提供任何进一步的解释。
编辑 12/10:
3 天后缓存状态如下:
"bytes currently in the cache" : 1319874144,
"bytes read into cache" : 1054001990,
"bytes written from cache" : 8936911271,
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1807 次 |
| 最近记录: |