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

How to reclaim or purge the FileSize of a collection

    XMLWordPrintableJSON

Details

    • Icon: Question Question
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • None
    • 2.0.6
    • Performance, Storage
    • None

    Description

      I have a database with only a collection. But FileSize of the UserDb db is huge, and there are lots of files on linux filesytem and disk' util% is high. How to reclaim or purge it.

      PRIMARY> show tables
      loginStatus
      system.indexes
      PRIMARY> db.loginStatus.stats()
      {
      "ns" : "UserDb.loginStatus",
      "count" : 57737693,
      "size" : 8290810936,
      "avgObjSize" : 143.59442688505064,
      "storageSize" : 35528597328,
      "numExtents" : 47,
      "nindexes" : 4,
      "lastExtentSize" : 2146426864,
      "paddingFactor" : 1,
      "flags" : 1,
      "totalIndexSize" : 16614400544,
      "indexSizes" :

      { "_id_" : 1873489520, "Time_1_SoftwareVer_1_Resource_1" : 3683884848, "UserId_1" : 5463791872, "Time_1_UserId_1" : 5593234304 }

      ,
      "ok" : 1
      }
      PRIMARY> db.stats()
      {
      "db" : "UserDb",
      "collections" : 3,
      "objects" : 58491118,
      "avgObjSize" : 143.59493302897715,
      "dataSize" : 8399028172,
      "storageSize" : 35528613712,
      "numExtents" : 49,
      "indexes" : 4,
      "indexSize" : 16834547520,
      "fileSize" : 102962823168,
      "nsSizeMB" : 16,
      "ok" : 1
      }

      ls /data/mongodb/data/UserDb/
      _tmp UserDb.13 UserDb.19 UserDb.24 UserDb.3 UserDb.35 UserDb.40 UserDb.46 UserDb.51
      UserDb.0 UserDb.14 UserDb.2 UserDb.25 UserDb.30 UserDb.36 UserDb.41 UserDb.47 UserDb.6
      UserDb.1 UserDb.15 UserDb.20 UserDb.26 UserDb.31 UserDb.37 UserDb.42 UserDb.48 UserDb.7
      UserDb.10 UserDb.16 UserDb.21 UserDb.27 UserDb.32 UserDb.38 UserDb.43 UserDb.49 UserDb.8
      UserDb.11 UserDb.17 UserDb.22 UserDb.28 UserDb.33 UserDb.39 UserDb.44 UserDb.5 UserDb.9
      UserDb.12 UserDb.18 UserDb.23 UserDb.29 UserDb.34 UserDb.4 UserDb.45 UserDb.50 UserDb.ns

      Attachments

        Activity

          People

            william.zola@10gen.com William Zola
            popgo Jianfeng Xu
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: