Implications of MongoDB’s
“usePowerOf2Sizes” Feature

Introduction
Problem Use Case
Activating “usePowerOf2Sizes”
Testing ...
Problematic Use Case

Insert document
Append to document
Append to document
Append to document
Delete document
Repeat
Pete...
Activating usePowerOf2Sizes

Example shell command to
activate usePowerOf2Sizes:
db.runCommand( { collMod : “collection_na...
Is usePowerOf2Sizes set?

To view the setting of
usePowerOf2Sizes:
db.collection_name.stats();

Inspect the “userFlags” va...
Testing Process





Create two collections
One uses usePowerOf2Sizes
The other does not
Insert the same documents to ...
Data Size Results
Final Data Size (KBytes)
600
500
400
300
200
100
0

Final Data
Size (KBytes)

Feature Not Feature Set
Se...
Storage Size Results
Final Storage Size (M-Bytes)
160
140
120
100
80
60
40
20
0

Final Storage
Size (M-Bytes)

Feature Not...
Compaction Ratio Results
Final Compaction Ratio
700
600
500
400
300
200
100
0

Final
Compaction
Ratio

Feature Not
Set

Fe...
Allocation Results
5000
4500
4000
3500
Allocation Size by
Insertion Count
Feature Not Set
Allocation Size by
Insertion Cou...
Performance Results

 Test duration using feature: 26.75s

 Test duration not using feature: 34.66s
 Percent improvemen...
Summary








Using the usePowerOf2Sizes feature results in
larger data size allocations

Using the usePowerOf2Sizes...
Parting Thoughts








If you are not consistently gathering data from your
IT infrastructure do you know when some
...
References


Reference Article
MongoDB Exorcises File Fragmentation Demons

java.sys-con.com/node/2756958


“usePowerOf2...
Upcoming SlideShare
Loading in …5
×

Use PowerOf2Sizes

322 views
237 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
322
On SlideShare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
4
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Use PowerOf2Sizes

  1. 1. Implications of MongoDB’s “usePowerOf2Sizes” Feature Introduction Problem Use Case Activating “usePowerOf2Sizes” Testing Approach Analysis of Test Results Pete Whitney, VP Cloud Development, FireScope, Inc.
  2. 2. Problematic Use Case Insert document Append to document Append to document Append to document Delete document Repeat Pete Whitney, VP Cloud Development, FireScope, Inc.
  3. 3. Activating usePowerOf2Sizes Example shell command to activate usePowerOf2Sizes: db.runCommand( { collMod : “collection_name", usePowerOf2Sizes : true } ); Pete Whitney, VP Cloud Development, FireScope, Inc.
  4. 4. Is usePowerOf2Sizes set? To view the setting of usePowerOf2Sizes: db.collection_name.stats(); Inspect the “userFlags” value from the returned results. A value of 1 indicates that usePowerOf2Sizes is in effect A value of 0 indicates that usePowerOf2Sizes is not in effect Pete Whitney, VP Cloud Development, FireScope, Inc.
  5. 5. Testing Process     Create two collections One uses usePowerOf2Sizes The other does not Insert the same documents to each collection  Update inserted documents  Delete documents  Retrieve and compare data size and storage size Pete Whitney, VP Cloud Development, FireScope, Inc.
  6. 6. Data Size Results Final Data Size (KBytes) 600 500 400 300 200 100 0 Final Data Size (KBytes) Feature Not Feature Set Set Pete Whitney, VP Cloud Development, FireScope, Inc.
  7. 7. Storage Size Results Final Storage Size (M-Bytes) 160 140 120 100 80 60 40 20 0 Final Storage Size (M-Bytes) Feature Not Set Feature Set Pete Whitney, VP Cloud Development, FireScope, Inc.
  8. 8. Compaction Ratio Results Final Compaction Ratio 700 600 500 400 300 200 100 0 Final Compaction Ratio Feature Not Set Feature Set Pete Whitney, VP Cloud Development, FireScope, Inc.
  9. 9. Allocation Results 5000 4500 4000 3500 Allocation Size by Insertion Count Feature Not Set Allocation Size by Insertion Count Feature Set 3000 2500 2000 1500 1000 500 0 5 10 15 20 25 30 35 40 45 Pete Whitney, VP Cloud Development, FireScope, Inc.
  10. 10. Performance Results  Test duration using feature: 26.75s  Test duration not using feature: 34.66s  Percent improvement: 22.8% Pete Whitney, VP Cloud Development, FireScope, Inc.
  11. 11. Summary     Using the usePowerOf2Sizes feature results in larger data size allocations Using the usePowerOf2Sizes feature results in significantly better use of storage size Using the usePowerOf2Sizes feature results in improved and sustained compaction ratio Using the usePowerOf2Sizes feature results in better performance for append operations due to reductions in the number of disk allocations and index updates Pete Whitney, VP Cloud Development, FireScope, Inc.
  12. 12. Parting Thoughts     If you are not consistently gathering data from your IT infrastructure do you know when some important portion of your business is failing to meet your customers needs? When you change something in your IT infrastructure do you know that the change is performing up to the expectations of your customers? Do you have the tools in place today that allow you to explore and identify issues, problems, bottlenecks throughout all of your IT assets? If not then check out: www.firescope.com Pete Whitney, VP Cloud Development, FireScope, Inc.
  13. 13. References  Reference Article MongoDB Exorcises File Fragmentation Demons java.sys-con.com/node/2756958  “usePowerOf2Sizes” Documentation docs.mongodb.org/manual/reference/command/collMod/  FireScope Inc. www.firescope.com  MongoDB www.mongodb.org  Pete Whitney pwhitney@firescope.com Pete Whitney, VP Cloud Development, FireScope, Inc.

×