1

I need to optimize my MongoDB performance but can't figure out how. Maybe there's some tips. Or maybe i should use another storage engine. Any ideas are welcome.

I have following log output in which are described query:

2015-08-04T15:09:56.226+0300 [conn129682] command mongodb_db1.$cmd command: aggregate { aggregate: "collection", pipeline: [ { $match: { _id.index_id_1: 4931359 } } ] } keyUpdates:0 numYields:39 locks(micros) r:83489 reslen:177280 286ms

I have collection named collection which contains following data structure:

{
  "_id" : {
    "x" : "x",
    "index_id_1" : NumberLong(5617088)
  },
  "value" : {
    "value_1" : 1.0000000000000000,
    "value_2" : 0.0000000000000000,
    "value_3" : 1.0000000000000000
  }
}

By querying stats in result i have following details:

 {
  "ns" : "mongodb_db1.collection",
  "count" : 2.07e+007,
  "size" : 4968000000.0000000000000000,
  "avgObjSize" : 240,
  "storageSize" : 5524459408.0000000000000000,
  "numExtents" : 25,
  "nindexes" : 3,
  "lastExtentSize" : 5.36601e+008,
  "paddingFactor" : 1.0000000000000000,
  "systemFlags" : 0,
  "userFlags" : 1,
  "totalIndexSize" : 4475975728.0000000000000000,
  "indexSizes" : {
    "_id_" : 2884043120.0000000000000000,
    "_id.x.index_id_1" : 1.07118e+009,
    "_id.index_id_1" : 5.20754e+008
  },
  "ok" : 1.0000000000000000
}
  • Running on single node ( no shards ).
  • MongoDB version is: 2.4.
  • Installed RAM (MB): 24017 ( index size ~120GB )
2
  • 2
    Indexes. Query log anaysis. The list goes on. Love to answer, but it seems more like a series of articles than a definative answer to me.Database query optimisation is not exactly a "new topic". Even if it does not "seem" at first to apply to your brand new shiny NoSQL ( old enough to have used databases before SQL was even spoke of ) solution, it probably actualy "does suit really well". If you take the time to interpret such articles, ( and practice the principles) then they will serve you very well. The wheel has existed for millennia. Time to stop re-inventing it. "Way too-broad" Commented Aug 4, 2015 at 12:55
  • Thank you for your answer. I see and understand that there's no definitely single answer for this question and there's many things who can impact performance. I have registered in one of @arober11 provided courses and i hope that would help me out. Commented Aug 5, 2015 at 15:16

1 Answer 1

1

10Gen / Mongodb are running a series of FREE online courses, that cover all you need to know (Latest iteration starts today). Simply head over and sign up for the DBA course, and if your feeling brave a couple of the others, but there is a lot of common / duplicated material, between all variants at the beginning.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for link! I have registered in one of these courses and i hope that would help me out.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.