装完最新的tokumx发现硬盘占用率和内存占用率确实比mongodb降了不少,但是CPU占用率即比原生的mongodb要高出很多,开始不解!
最后在http://docs.tokutek.com/tokumx/tokumx-tuning-production.html上有这样的描述:
CPU
CPU usage is attributed to:
Compression work
When data blocks are written to disk (for checkpoint or when evicted while dirty, in the presence of memory pressure), they are first compressed, and compression is primarily CPU work. Decompression is generally much cheaper than compression, and is hardly noticeable next to the disk I/O done just before it, even on most SSDs.
Message application
High-volume update workloads tend to stress this subsystem, which updates the data in leaves with the result of applying deferred operations above them in the tree. Small updates to large documents can disproportionately stress this system, in that case it can help to break up a large document into smaller documents and rely on TokuMX's multi-document transactional semantics to read the same data consistently later.
Miscellaneous tasks
Tree searches, serialization and deserialization, sorting for aggregation, and other things common to most databases.
Building indexes
Compressing intermediate files during bulk load of indexes (foreground ensureIndex operations as well as loading collections with mongorestore).
tokumx的cpu占用率比原生mogodb偏高的原因应该是用在写入数据时压缩上了。