Wired Tiger Block Manager

555 views
Skip to first unread message

Deepjyoti Saha

unread,
Jul 22, 2015, 4:48:58 PM7/22/15
to mongodb-user
Hello guys ..
Can anyone explain me whats the purpose of the wiredTiger Block Manager and how is it related to the storage ..
> db.collection.stats()

The storage size in the disk is : 16k for the collection and 16k for the Index.


deep:SECONDARY> db.coll1.stats()
{
        "ns" : "deep.coll1",
        "count" : 1,
        "size" : 33,
        "avgObjSize" : 33,
        "storageSize" : 16384,
        "capped" : false,
        "wiredTiger" : {
                "metadata" : {
                        "formatVersion" : 1
                },
                "creationString" : "allocation_size=4KB,app_metadata=(formatVersion=1),block_allocation=best,block_compressor=snappy,cache_resident=0,checkpoint=(WiredTigerCheckpoint.2=(addr=\"018181e46ee5faa18281e4f2e09da0808080808080e21fc0dfc0\",order=2,time=1437571321,size=8192,write_gen=2)),checkpoint_lsn=(4294967295,9223372036854775807),checksum=on,collator=,columns=,dictionary=0,format=btree,huffman_key=,huffman_value=,id=21,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=1MB,memory_page_max=10m,os_cache_dirty_max=0,os_cache_max=0,prefix_compression=0,prefix_compression_min=4,split_deepen_min_child=0,split_deepen_per_child=0,split_pct=90,value_format=u,version=(major=1,minor=1)",
                "type" : "file",
                "uri" : "statistics:table:collection-18-5199270674712722350",
                "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" : 3,
                        "checkpoint size" : 8192,
                        "allocations requiring file extension" : 3,
                        "blocks freed" : 0,
                        "file magic number" : 120897,
                        "file major version number" : 1,
                        "minor version number" : 0,
                        "file bytes available for reuse" : 0,
                        "file size in bytes" : 16384
                },
                "btree" : {
                        "btree checkpoint generation" : 62,
                        "column-store variable-size deleted values" : 0,
                        "column-store fixed-size leaf pages" : 0,
                        "column-store internal pages" : 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" : 3,
                        "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" : 1048576,
                        "overflow pages" : 0,
                        "row-store internal pages" : 0,
                        "row-store leaf pages" : 0
                },
                "cache" : {
                        "bytes read into cache" : 0,
                        "bytes written from cache" : 127,
                        "checkpoint blocked page eviction" : 0,
                        "unmodified pages evicted" : 0,
                        "page split during eviction deepened the tree" : 0,
                        "modified pages evicted" : 0,
                        "data source pages selected for eviction unable to be evicted" : 0,
                        "hazard pointer blocked page eviction" : 0,
                        "internal pages evicted" : 0,
                        "pages split during eviction" : 0,
                        "in-memory page splits" : 0,
                        "overflow values cached in memory" : 0,
                        "pages read into cache" : 0,
                        "overflow pages read into cache" : 0,
                        "pages written from cache" : 2
                },
                "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" : 0,
                        "compressed pages written" : 0,
                        "page written failed to compress" : 0,
                        "page written was too small to compress" : 2
                },
                "cursor" : {
                        "create calls" : 3,
                        "insert calls" : 1,
                        "bulk-loaded cursor-insert calls" : 0,
                        "cursor-insert key and value bytes inserted" : 34,
                        "maximum leaf page size" : 32768,
                        "next calls" : 2,
                        "prev calls" : 1,
                        "remove calls" : 0,
                        "cursor-remove key bytes removed" : 0,
                        "reset calls" : 3,
                        "search calls" : 0,
                        "search near calls" : 0,
                        "update calls" : 0,
                        "cursor-update value bytes updated" : 0
                },
                "reconciliation" : {
                        "dictionary matches" : 0,
                        "internal page multi-block writes" : 0,
                        "leaf page multi-block writes" : 0,
                        "maximum blocks required for a page" : 0,
                        "internal-page overflow keys" : 0,
                        "leaf-page overflow keys" : 0,
                        "overflow values written" : 0,
                        "pages deleted" : 0,
                        "page checksum matches" : 0,
                        "page reconciliation calls" : 2,
                        "page reconciliation calls for eviction" : 0,
                        "leaf page key bytes discarded using prefix compression" : 0,
                        "internal page key bytes discarded using suffix compression" : 0
                },
                "session" : {
                        "object compaction" : 0,
                        "open cursor count" : 3
                },
                "transaction" : {
                        "update conflicts" : 0
                }
        },
        "nindexes" : 1,
        "totalIndexSize" : 16384,
        "indexSizes" : {
                "_id_" : 16384
        },
        "ok" : 1
}

Thanks in Advance..

Alexander Gorrod

unread,
Jul 22, 2015, 9:32:33 PM7/22/15
to mongodb-user, deepjyot...@gmail.com
The block manager in WiredTiger manages the layout of the data on disk. WiredTiger is an MVCC system so it doesn't overwrite data in place, it also provides support for maintaining consistent snapshots on disk (checkpoints). These two features require that the on-disk layout in WiredTiger is complex - and it is managed by the block manager.

The block manager statistics allow you to get information about how the on-disk data management is working. For example:

"file size in bytes" Tells you the on-disk size for the particular collection.

"file bytes available for reuse" Tells you how much free space is in the file (i.e it gives you an idea of how much fragmentation is present).

If you have specific questions about other statistics I'm happy to answer them.


Deepjyoti Saha

unread,
Jul 23, 2015, 1:09:17 AM7/23/15
to mongodb-user
Thanks Alexander for help..
I want to know
1. How MongoDB WiredTiger allocates blocks when one operation(find/insert/update/delete) is performed .
2. In detail explanation of each field of "Block Manager"
Reply all
Reply to author
Forward
0 new messages