Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-6218

Profile documents should include partial query object instead of "too large" error

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 2.0.5
    • Fix Version/s: 2.8.0-rc2
    • Component/s: Diagnostics
    • Labels:
      None
    • Environment:
      Linux 64 Bit
    • Sprint:
      Server 2.7.3, Server 2.7.4, Query 2.7.8

      Description

      When a profile line becomes too large, essential fields as for example "millis" are omitted:

      PRIMARY> db.system.profile.findOne({err:{$exists:true},abbreviated:{$exists:false}})
      {
          "ts" : ISODate("2012-06-26T04:37:06.372Z"),
          "client" : "x.x.x.x",
          "user" : "",
          "err" : "profile line too large (max is 100KB)"
      }

      However, in some cases there is a field "abbreviated" in which we can find the missing "millis" field:

      PRIMARY> db.system.profile.findOne({err:{$exists:true},abbreviated:{$exists:true}})
      {
          "ts" : ISODate("2012-06-24T19:02:46.054Z"),
          "client" : "x.x.x.x",
          "user" : "",
          "err" : "profile line too large (max is 100KB)",
          "abbreviated" : "{ ts: new Date(1340564566053), op: \"getmore\", ns: \"offerStore.offer\", query: { _id: { $in: [ 258406435, ...cut out... ] } }, cursorid: 532897853037598938, nreturned: 2708, responseLength: 4195498, millis: 5620, client: \"x.x.x.x\", user: \"\" }"
      }

      As the field "abbreviated" is a String, not an Object, we can't even use dot notation to reach into the object to retrieve millis. Thus, we need to use eval or a regexp to do so.

      Essential information like millis, cursorid, nreturned, responseLength, client and user should ALWAYS be present in a profiling document. When the profile line is too large, then it's certainly not to large because of these fields. It's too large because of the query! So cut out or shorten the query but not the other fields!

      Last but not least: What are the rules to have an "abbreviated" field or not? Btw. what has been abbreviated - it seems to be complete though?

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                4 Vote for this issue
                Watchers:
                14 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: