如何限制Mongodb索引大​​小

时间:2016-11-02 06:18:46

标签: mongodb mongoose


 我使用Mongodb 3.2.1和有线Tiger引擎。目前我的收集索引大小之一是29879107584,我在Ubuntu 14.04系统中有30GB的RAM。是否有任何配置,我可以设置集合使用有限的索引大小而不是上面。在这种情况下,它会影响新文档的插入。以下是收集统计和样本文件。

{
        "ns" : "XXX.AAA",
        "count" : 749609911,
        "size" : 140729861965,
        "avgObjSize" : 187,
        "storageSize" : 37054742528,
        "capped" : false,
        "wiredTiger" : {
                "metadata" : {
                        "formatVersion" : 1
                },
                "creationString" : "allocation_size=4KB,app_metadata=(formatVersion=1),block_allocation=best,block_compressor=snappy,cache_resident=0,checksum=on,colgroups=,collator=,columns=,dictionary=0,encryption=(keyid=,name=),exclusive=0,extractor=,format=btree,huffman_key=,huffman_value=,immutable=0,internal_item_max=0,internal_key_max=0,internal_key_truncate=,internal_page_max=4KB,key_format=q,key_gap=10,leaf_item_max=0,leaf_key_max=0,leaf_page_max=32KB,leaf_value_max=64MB,log=(enabled=),lsm=(auto_throttle=,bloom=,bloom_bit_count=16,bloom_config=,bloom_hash_count=8,bloom_oldest=0,chunk_count_limit=0,chunk_max=5GB,chunk_size=10MB,merge_max=15,merge_min=0),memory_page_max=10m,os_cache_dirty_max=0,os_cache_max=0,prefix_compression=0,prefix_compression_min=4,source=,split_deepen_min_child=0,split_deepen_per_child=0,split_pct=90,type=file,value_format=u",
                "type" : "file",
                "uri" : "statistics:table:collection-11-7249043912214591751",
                "LSM" : {
                        "bloom filters in the LSM tree" : 0,
                        "bloom filter false positives" : 0,
                        "bloom filter hits" : 0,
                        "bloom filter misses" : 0,
                        "bloom filter pages evicted from cache" : 0,
                        "bloom filter pages read into cache" : 0,
                        "total size of bloom filters" : 0,
                        "sleep for LSM checkpoint throttle" : 0,
                        "chunks in the LSM tree" : 0,
                        "highest merge generation in the LSM tree" : 0,
                        "queries that could have benefited from a Bloom filter that did not exist" : 0,
                        "sleep for LSM merge throttle" : 0
                },
                "block-manager" : {
                        "file allocation unit size" : 4096,
                        "blocks allocated" : 2056317,
                        "checkpoint size" : 37069619200,
                        "allocations requiring file extension" : 2041522,
                        "blocks freed" : 16252,
                        "file magic number" : 120897,
                        "file major version number" : 1,
                        "minor version number" : 0,
                        "file bytes available for reuse" : 53248,
                        "file size in bytes" : 37054742528
                },
                "btree" : {
                        "btree checkpoint generation" : 42209,
                        "column-store variable-size deleted values" : 0,
                        "column-store fixed-size leaf pages" : 0,
                        "column-store internal pages" : 0,
                        "column-store variable-size RLE encoded values" : 0,
                        "column-store variable-size leaf pages" : 0,
                        "pages rewritten by compaction" : 0,
                        "number of key/value pairs" : 0,
                        "fixed-record size" : 0,
                        "maximum tree depth" : 5,
                        "maximum internal page key size" : 368,
                        "maximum internal page size" : 4096,
                        "maximum leaf page key size" : 3276,
                        "maximum leaf page size" : 32768,
                        "maximum leaf page value size" : 67108864,
                        "overflow pages" : 0,
                        "row-store internal pages" : 0,
                        "row-store leaf pages" : 0
                },
                "cache" : {
                        "bytes read into cache" : 795145173593,
                        "bytes written from cache" : 66009307193,
                        "checkpoint blocked page eviction" : 0,
                        "unmodified pages evicted" : 24432718,
                        "page split during eviction deepened the tree" : 0,
                        "modified pages evicted" : 28826,
                        "data source pages selected for eviction unable to be evicted" : 100549,
                        "hazard pointer blocked page eviction" : 55965,
                        "internal pages evicted" : 235292,
                        "internal pages split during eviction" : 150,
                        "leaf pages split during eviction" : 12518,
                        "in-memory page splits" : 9408,
                        "in-memory page passed criteria to be split" : 18910,
                        "overflow values cached in memory" : 0,
                        "pages read into cache" : 24602873,
                        "pages read into cache requiring lookaside entries" : 0,
                        "overflow pages read into cache" : 0,
                        "pages written from cache" : 2053921,
                        "page written requiring lookaside records" : 0,
                        "pages written requiring in-memory restoration" : 0
                },
                "compression" : {
                        "raw compression call failed, no additional data available" : 0,
                        "raw compression call failed, additional data available" : 0,
                        "raw compression call succeeded" : 0,
                        "compressed pages read" : 24372175,
                        "compressed pages written" : 2023673,
                        "page written failed to compress" : 0,
                        "page written was too small to compress" : 30248
                },
                "cursor" : {
                        "create calls" : 1288,
                        "insert calls" : 332854777,
                        "bulk-loaded cursor-insert calls" : 0,
                        "cursor-insert key and value bytes inserted" : 64441812745,
                        "next calls" : 1531315547,
                        "prev calls" : 1,
                        "remove calls" : 426721,
                        "cursor-remove key bytes removed" : 2133605,
                        "reset calls" : 411834660,
                        "restarted searches" : 10489,
                        "search calls" : 3004784718,
                        "search near calls" : 12020300,
                        "truncate calls" : 0,
                        "update calls" : 0,
                        "cursor-update value bytes updated" : 0
                },
                "reconciliation" : {
                        "dictionary matches" : 0,
                        "internal page multi-block writes" : 1385,
                        "leaf page multi-block writes" : 12742,
                        "maximum blocks required for a page" : 20,
                        "internal-page overflow keys" : 0,
                        "leaf-page overflow keys" : 0,
                        "overflow values written" : 0,
                        "pages deleted" : 2669,
                        "fast-path pages deleted" : 0,
                        "page checksum matches" : 58274,
                        "page reconciliation calls" : 33906,
                        "page reconciliation calls for eviction" : 16209,
                        "leaf page key bytes discarded using prefix compression" : 0,
                        "internal page key bytes discarded using suffix compression" : 2069008
                },
                "session" : {
                        "object compaction" : 0,
                        "open cursor count" : 4
                },
                "transaction" : {
                        "update conflicts" : 0
                }
        },
        "nindexes" : 4,
        "totalIndexSize" : 30414229504,
        "indexSizes" : {
                "_id_" : 7513280512,
                "bookid_1_sheetname_1_top_1_bottom_1_column_1" : 6909124608,
                "bookid_1_sheetname_1_row_1_column_1" : 7578796032,
                "bookid_1_sheetname_1_row_1_column_1_value_1" : 8413028352
        },
        "ok" : 1
}



{
        "_id" : ObjectId("54fdf0540cf26047a823e123"),
        "height" : 15,
        "sheetname" : "Test Sheet",
        "width" : 225,
        "value" : "Test",
        "bottom" : 14,
        "column" : 1,
        "left" : 0,
        "right" : 224,
        "row" : 1,
        "top" : 0,
        "bookid" : ObjectId("54fdf0537a0a58734f11aa17")
}

0 个答案:

没有答案