MongoDB 3 with WiredTiger: High CPU usage

We have 3 copies in a replica. Primary with 2 cores and 4 GB of RAM. Secondary with 1 CPU and 4 GB of RAM. Arbiter with 1 CPU and 2GB of RAM.

First test:

MongoDB-org-server 2.6.10-1.x86_64

logpath=/var/log/mongodb/mongod.log
logappend=true
fork=true
dbpath=/mnt/mongo
pidfilepath=/var/run/mongodb/mongod.pid

      

And second test: mongodb-org-server-3.0.4-1.x86_64

processManagement:
    pidFilePath: "/var/run/mongodb/mongod.pid"
    fork: true
storage:
    dbPath: "/mnt/mongo/"
    engine: "wiredTiger"
    wiredTiger:
        collectionConfig: 
            blockCompressor: none
        engineConfig: 
            cacheSizeGB: 2
            journalCompressor: none
        indexConfig:
            prefixCompression: false
systemLog:
    destination: file
    path: "/var/log/mongodb/mongod.log"
    logAppend: true
replication:
    replSetName: testrepl

      

CPU Usage: http://i.imgur.com/Nmj021g.png

Under the same load, we have 2x CPU load on MongoDB 3 with WiredTiger engine.

MongoDB Statistics: http://i.imgur.com/cxrfUIC.png

So the question is why MongoDB 3 with WiredTiger uses 2x more CPU? Is this normal for WiredTiger? The data in the database has not changed between the test. We have the same scenario for testing the load both times.

+3


source to share


2 answers


[EDIT: The answer discusses WiredTiger in general, but not specifically for this problem. See Comments.]

Yes, it is normal. WiredTiger compresses data , which costs CPU. He recommended to provide sufficient processor, because with WiredTiger the processor becomes a bottleneck. See More Performance Tips .



In our case, for example, between identical MMAPv1 (old storage engine) and WiredTiger servers, the CPU usage increased by about 2x and the datastore size decreased by 3x-5x. The data is also compressed in RAM, so you can fit more indexes / caches into the same amount of RAM.

+1


source


According to this thread in the MongoDB user group , an increased load is expected for the WireTiger storage engine.



0


source







All Articles