Upgrade to Pro — share decks privately, control downloads, hide ads and more …

MongoDB performance at scale - WebPerfDays 2012

MongoDB performance at scale - WebPerfDays 2012

A technical look at how we get fast performance out of the box processing over 15TB of data a month with MongoDB.

Presented at http://webperfdays.org/ 2012 by David Mytton

Server Density

October 05, 2012
Tweet

More Decks by Server Density

Other Decks in Technology

Transcript

  1. •MySQL -> MongoDB •15TB data per month •27 nodes MongoDB

    at Server Density • June 2009 - +3yrs
  2. Fast out of the box? Photo: dannychoo.com • Local instance

    storage • Softlayer cloud (1 core, 8GB)
  3. Fast out of the box? Photo: dannychoo.com • Local instance

    storage • Ubuntu 10.04 LTS • Softlayer cloud (1 core, 8GB)
  4. Picture is unrelated! Mmm, ice cream. Fast out of the

    box? • Fast network • Working set in RAM
  5. mongos> db.metrics_20120508_15_1m.stats() { "sharded" : true, "flags" : 1, "ns"

    : "metrics.metrics_20120508_15_1m", "count" : 2752934, "numExtents" : 46, "size" : 746837640, "storageSize" : 823717888, "totalIndexSize" : 517581680, "indexSizes" : { "_id_" : 130358144, "a_1_i_1" : 155711920, "a_1_i_1_m_1_t_1" : 231511616 }, "avgObjSize" : 271.2878841265355, "nindexes" : 3, "nchunks" : 61,
  6. Picture is unrelated! Mmm, ice cream. Fast out of the

    box? • Fast network • Working set in RAM
  7. Picture is unrelated! Mmm, ice cream. Fast out of the

    box? • Fast network • Working set in RAM • Fast disks (optional)
  8. Picture is unrelated! Mmm, ice cream. Fast out of the

    box? • Fast network • Working set in RAM • Fast disks (optional)
  9. Picture is unrelated! Mmm, ice cream. Fast out of the

    box? • Fast network • Working set in RAM • Fast disks (optional) • Sharding (optional)
  10. Tags { _id : "someSet", members : [ {_id :

    0, host : "A", tags : {"dc": "ny"}}, {_id : 1, host : "B", tags : {"dc": "ny"}}, {_id : 2, host : "C", tags : {"dc": "sf"}}, {_id : 3, host : "D", tags : {"dc": "sf"}}, {_id : 4, host : "E", tags : {"dc": "cloud"}} ] settings : { getLastErrorModes : { veryImportant : {"dc" : 3}, sortOfImportant : {"dc" : 2} } } } > db.foo.insert({x:1}) > db.runCommand({getLastError : 1, w : "veryImportant"})
  11. { _id : "someSet", members : [ {_id : 0,

    host : "A", tags : {"dc": "ny"}}, {_id : 1, host : "B", tags : {"dc": "ny"}}, {_id : 2, host : "C", tags : {"dc": "sf"}}, {_id : 3, host : "D", tags : {"dc": "sf"}}, {_id : 4, host : "E", tags : {"dc": "cloud"}} ] settings : { getLastErrorModes : { veryImportant : {"dc" : 3}, sortOfImportant : {"dc" : 2} } } } > db.foo.insert({x:1}) > db.runCommand({getLastError : 1, w : "veryImportant"}) (A or B) + (C or D) + E Tags
  12. { _id : "someSet", members : [ {_id : 0,

    host : "A", tags : {"dc": "ny"}}, {_id : 1, host : "B", tags : {"dc": "ny"}}, {_id : 2, host : "C", tags : {"dc": "sf"}}, {_id : 3, host : "D", tags : {"dc": "sf"}}, {_id : 4, host : "E", tags : {"dc": "cloud"}} ] settings : { getLastErrorModes : { veryImportant : {"dc" : 3}, sortOfImportant : {"dc" : 2} } } } > db.foo.insert({x:1}) > db.runCommand({getLastError : 1, w : "sortOfImportant"}) (A + C) or (D + E) ... Tags
  13. Picture is unrelated! Mmm, ice cream. Fast out of the

    box? • Fast network • Working set in RAM
  14. Picture is unrelated! Mmm, ice cream. Fast out of the

    box? • Fast network • Working set in RAM • bit.ly/benchrun