2016-06-14 3 views
5

우리는 큰 MongoDB 데이터베이스 (약 1,4ml 컬렉션), MongoDB 3.0, 엔진 rocksDB, 운영 시스템 우분투 14.04를 보유하고 있습니다.MongoDB 서버 freeze - 대량의 콜렉션

이 DB는 16 코어 및 108GB RAM (현재 mongoDB는 스왑없이 70GB의 메모리를 사용함)이있는 가상 시스템 (VmWare vCloud)에 있습니다.

생산 설정 옵션 : 전용 파티션에

  • 데이터 - XFS 파일 시스템
  • transparent_hugepage 활성화 - 결코
  • transparent_hugepage 조각 모음 - 결코

DB 통계 :

{ 
    "db" : "ctp", 
    "collections" : 1369486, 
    "objects" : 20566852, 
    "avgObjSize" : 1126.82749999854, 
    "dataSize" : 23175294422, 
    "storageSize" : 23231888384, 
    "numExtents" : 0, 
    "indexes" : 6686175, 
    "indexSize" : 685981393, 
    "ok" : 1 
} 

샘플 컬렉션 크기 :

{ 
    "ns" : "ctp._cf123_ct49_dfc-r_dtc-r_tof2_groupat", 
    "count" : 33, 
    "size" : 38172, 
    "avgObjSize" : 1156, 
    "storageSize" : 38144, 
    "capped" : false, 
    "nindexes" : 5, 
    "totalIndexSize" : 6312, 
    "indexSizes" : { 
     "_id_" : 18, 
     "exAt" : 16, 
     "unique" : 6246, 
     "_smp" : 10, 
     "_smpdf" : 22 
    }, 
    "ok" : 1 
} 

{ 
    "ns" : "ctp._afpoznan123_atlondyn49_df2016-09_dt2016-09_tof2_groupdfdt", 
    "count" : 188, 
    "size" : 208677, 
    "avgObjSize" : 1109, 
    "storageSize" : 208640, 
    "capped" : false, 
    "nindexes" : 5, 
    "totalIndexSize" : 7945, 
    "indexSizes" : { 
     "_id_" : 2845, 
     "exAt" : 256, 
     "_smp" : 160, 
     "_smpdf" : 352, 
     "unique" : 4332 
    }, 
    "ok" : 1 
} 
{ 
    "ns" : "ctp._cf123_ct42_dfc-r_dtc-r_tof2_groupat", 
    "count" : 27, 
    "size" : 30400, 
    "avgObjSize" : 1125, 
    "storageSize" : 30208, 
    "capped" : false, 
    "nindexes" : 5, 
    "totalIndexSize" : 84, 
    "indexSizes" : { 
     "_id_" : 18, 
     "exAt" : 16, 
     "unique" : 18, 
     "_smp" : 10, 
     "_smpdf" : 22 
    }, 
    "ok" : 1 
} 

주기적으로 5 분마다 이러한 컬렉션을 기록하고이 컬렉션이 없습니다 (컬렉션 이름은 이러한 컬렉션 안에있는 데이터를 기반으로) 및 생성 존재 않을 경우 새로 생성 스크립트를 실행 색인.

우리는이 서버가 컬렉션에 데이터를 쓰는 동안 약간의 정지가 있음을 확인했습니다. 이러한 종류의 동결에는 5 ~ 60 초가 소요될 수 있습니다.

이 문제가 발생하여 도움이 될만한 사람이 있습니까? screen from mongostat

: mongostat에서

db.currentOP(); 

    "opid" : 22717868, 
     "active" : false, 
     "op" : "query", 
     "ns" : "ctp._cf115_atboma25_dfc-r_dtc-r_tof2_groupdfym", 
     "query" : { 
      "$query" : { 
       "T#df" : { 
        "$lt" : "2017-02-28" 
       } 
      }, 
      "$orderby" : { 
       "T#mp" : NumberLong(1) 
      } 
     }, 
     "client" : "192.168.1.33:33832", 
     "numYields" : 0, 
     "locks" : { 
      "Global" : "r", 
      "Database" : "r" 
     }, 
     "waitingForLock" : true, 
     "lockStats" : { 
      "Global" : { 
       "acquireCount" : { 
        "r" : NumberLong(2) 
       } 
      }, 
      "Database" : { 
       "acquireCount" : { 
        "r" : NumberLong(1) 
       }, 
       "acquireWaitCount" : { 
        "r" : NumberLong(1) 
       }, 
       "timeAcquiringMicros" : { 
        "r" : NumberLong(22004831) 
       } 
      } 
     } 
    }, 
    { 
     "desc" : "conn135907", 
     "threadId" : "0xc3e5d64e0", 
     "connectionId" : 135907, 
     "opid" : 22719375, 
     "active" : true, 
     "secs_running" : 0, 
     "microsecs_running" : NumberLong(223601), 
     "op" : "query", 
     "ns" : "top_search.top_searches", 
     "query" : { 
      "$msg" : "query not recording (too large)" 
     }, 
     "planSummary" : "IXSCAN { T#df: 1, T#dt: 1 }", 
     "client" : "192.168.1.33:33648", 
     "numYields" : 170, 
     "locks" : { 
      "Global" : "r", 
      "Database" : "r", 
      "Collection" : "r" 
     }, 
     "waitingForLock" : false, 
     "lockStats" : { 
      "Global" : { 
       "acquireCount" : { 
        "r" : NumberLong(342) 
       } 
      }, 
      "Database" : { 
       "acquireCount" : { 
        "r" : NumberLong(171) 
       } 
      }, 
      "Collection" : { 
       "acquireCount" : { 
        "r" : NumberLong(171) 
       } 
      } 
     } 
    }, 
    { 
     "desc" : "conn135959", 
     "threadId" : "0x10d4445260", 
     "connectionId" : 135959, 
     "opid" : 22718533, 
     "active" : false, 
     "op" : "query", 
     "ns" : "ctp._afoxford-house23_attamarindo32_dfc-r_dtc-r_tof2_groupdfdt", 
     "query" : { 
      "$query" : {}, 
      "$orderby" : { 
       "T#mp" : NumberLong(1), 
       "T#df" : NumberLong(1) 
      } 
     }, 
     "client" : "192.168.1.33:34022", 
     "numYields" : 0, 
     "locks" : { 
      "Global" : "r", 
      "Database" : "r" 
     }, 
     "waitingForLock" : true, 
     "lockStats" : { 
      "Global" : { 
       "acquireCount" : { 
        "r" : NumberLong(2) 
       } 
      }, 
      "Database" : { 
       "acquireCount" : { 
        "r" : NumberLong(1) 
       }, 
       "acquireWaitCount" : { 
        "r" : NumberLong(1) 
       }, 
       "timeAcquiringMicros" : { 
        "r" : NumberLong(15003580) 
       } 
      } 
     } 
    }, 
    { 
     "desc" : "conn135829", 
     "threadId" : "0x10d4445740", 
     "connectionId" : 135829, 
     "opid" : 22717923, 
     "active" : false, 
     "op" : "query", 
     "ns" : "ctp._ct123_dfc-r_dtc-r_tof2_groupdfym", 
     "query" : { 
      "$query" : { 
       "T#df" : { 
        "$lt" : "2017-02-28" 
       } 
      }, 
      "$orderby" : { 
       "T#mp" : NumberLong(1) 
      } 
     }, 
     "client" : "192.168.1.33:33026", 
     "numYields" : 0, 
     "locks" : { 
      "Global" : "r", 
      "Database" : "r" 
     }, 
     "waitingForLock" : true, 
     "lockStats" : { 
      "Global" : { 
       "acquireCount" : { 
        "r" : NumberLong(2) 
       } 
      }, 
      "Database" : { 
       "acquireCount" : { 
        "r" : NumberLong(1) 
       }, 
       "acquireWaitCount" : { 
        "r" : NumberLong(1) 
       }, 
       "timeAcquiringMicros" : { 
        "r" : NumberLong(21004810) 
       } 
      } 
     } 
    }, 
    { 
     "desc" : "conn135781", 
     "threadId" : "0x2d678e0", 
     "connectionId" : 135781, 
     "opid" : 22718920, 
     "active" : false, 
     "op" : "query", 
     "ns" : "ctp._cf1147_atrostock36_df2016-06_dtc-r_tof2_groupaf", 
     "query" : { 
      "$query" : {}, 
      "$orderby" : { 
       "T#mp" : NumberLong(1) 
      } 
     }, 
     "client" : "192.168.1.33:60874", 
     "numYields" : 0, 
     "locks" : { 
      "Global" : "r", 
      "Database" : "r" 
     }, 
     "waitingForLock" : true, 
     "lockStats" : { 
      "Global" : { 
       "acquireCount" : { 
        "r" : NumberLong(2) 
       } 
      }, 
      "Database" : { 
       "acquireCount" : { 
        "r" : NumberLong(1) 
       }, 
       "acquireWaitCount" : { 
        "r" : NumberLong(1) 
       }, 
       "timeAcquiringMicros" : { 
        "r" : NumberLong(12002770) 
       } 
      } 
     } 
    }, 
    { 
     "desc" : "conn135870", 
     "threadId" : "0xd04ed5d40", 
     "connectionId" : 135870, 
     "opid" : 22719172, 
     "active" : false, 
     "op" : "query", 
     "ns" : "ctp._cf61_atpristina131_dfc-r_dtc-r_tof2_groupaf", 
     "query" : { 
      "$query" : {}, 
      "$orderby" : { 
       "T#mp" : NumberLong(1) 
      } 
     }, 
     "client" : "192.168.1.33:33369", 
     "numYields" : 0, 
     "locks" : { 
      "Global" : "r", 
      "Database" : "r" 
     }, 
     "waitingForLock" : true, 
     "lockStats" : { 
      "Global" : { 
       "acquireCount" : { 
        "r" : NumberLong(2) 
       } 
      }, 
      "Database" : { 
       "acquireCount" : { 
        "r" : NumberLong(1) 
       }, 
       "acquireWaitCount" : { 
        "r" : NumberLong(1) 
       }, 
       "timeAcquiringMicros" : { 
        "r" : NumberLong(7001590) 
       } 
      } 
     } 
    }, 
    { 
     "desc" : "conn135687", 
     "threadId" : "0xc3e5d7380", 
     "connectionId" : 135687, 
     "opid" : 22717925, 
     "active" : false, 
     "op" : "query", 
     "ns" : "ctp._cf105_athana156_df2016-06_dt2016-06_tof2_groupaf", 
     "query" : { 
      "$query" : {}, 
      "$orderby" : { 
       "T#mp" : NumberLong(1) 
      } 
     }, 
     "client" : "192.168.1.33:60022", 
     "numYields" : 0, 
     "locks" : { 
      "Global" : "r", 
      "Database" : "r" 
     }, 
     "waitingForLock" : true, 
     "lockStats" : { 
      "Global" : { 
       "acquireCount" : { 
        "r" : NumberLong(2) 
       } 
      }, 
      "Database" : { 
       "acquireCount" : { 
        "r" : NumberLong(1) 
       }, 
       "acquireWaitCount" : { 
        "r" : NumberLong(1) 
       }, 
       "timeAcquiringMicros" : { 
        "r" : NumberLong(21003871) 
       } 
      } 
     } 
    }, 
    { 
     "desc" : "conn135754", 
     "threadId" : "0xd04ed5860", 
     "connectionId" : 135754, 
     "opid" : 22718485, 
     "active" : false, 
     "op" : "query", 
     "ns" : "ctp._cf5_atdhaka1113_dfc-r_dtc-r_tof2_groupaf", 
     "query" : { 
      "$query" : {}, 
      "$orderby" : { 
       "T#mp" : NumberLong(1) 
      } 
     }, 
     "client" : "192.168.1.33:60603", 
     "numYields" : 0, 
     "locks" : { 
      "Global" : "r", 
      "Database" : "r" 
     }, 
     "waitingForLock" : true, 
     "lockStats" : { 
      "Global" : { 
       "acquireCount" : { 
        "r" : NumberLong(2) 
       } 
      }, 
      "Database" : { 
       "acquireCount" : { 
        "r" : NumberLong(1) 
       }, 
       "acquireWaitCount" : { 
        "r" : NumberLong(1) 
       }, 
       "timeAcquiringMicros" : { 
        "r" : NumberLong(15503084) 
       } 
      } 
     } 
    }, 
    { 
     "desc" : "conn135644", 
     "threadId" : "0xc3e5d9c20", 
     "connectionId" : 135644, 
     "opid" : 22719073, 
     "active" : false, 
     "op" : "query", 
     "ns" : "ctp._afgenua71_ataarhus37_dfc-r_dtc-r_tof2_groupdfdt", 
     "query" : { 
      "$query" : {}, 
      "$orderby" : { 
       "T#mp" : NumberLong(1), 
       "T#df" : NumberLong(1) 
      } 
     }, 
     "client" : "192.168.1.33:59698", 
     "numYields" : 0, 
     "locks" : { 
      "Global" : "r", 
      "Database" : "r" 
     }, 
     "waitingForLock" : true, 
     "lockStats" : { 
      "Global" : { 
       "acquireCount" : { 
        "r" : NumberLong(2) 
       } 
      }, 
      "Database" : { 
       "acquireCount" : { 
        "r" : NumberLong(1) 
       }, 
       "acquireWaitCount" : { 
        "r" : NumberLong(1) 
       }, 
       "timeAcquiringMicros" : { 
        "r" : NumberLong(7501602) 
       } 
      } 
     } 
    }, 
    { 
     "desc" : "conn135891", 
     "threadId" : "0xd04ed7a80", 
     "connectionId" : 135891, 
     "opid" : 22719284, 
     "active" : false, 
     "op" : "query", 
     "ns" : "ctp._attianjin30_dfc-r_dtc-r_tof2_groupcf", 
     "query" : { 
      "$query" : {}, 
      "$orderby" : { 
       "T#mp" : NumberLong(1) 
      } 
     }, 
     "client" : "192.168.1.33:33530", 
     "numYields" : 0, 
     "locks" : { 
      "Global" : "r", 
      "Database" : "r" 
     }, 
     "waitingForLock" : true, 
     "lockStats" : { 
      "Global" : { 
       "acquireCount" : { 
        "r" : NumberLong(2) 
       } 
      }, 
      "Database" : { 
       "acquireCount" : { 
        "r" : NumberLong(1) 
       }, 
       "acquireWaitCount" : { 
        "r" : NumberLong(1) 
       }, 
       "timeAcquiringMicros" : { 
        "r" : NumberLong(3000658) 
       } 
      } 
     } 
    }, 
    { 
     "desc" : "conn135673", 
     "threadId" : "0xd04ed6220", 
     "connectionId" : 135673, 
     "opid" : 22718185, 
     "active" : false, 
     "op" : "query", 
     "ns" : "ctp._afwroclaw123_atlondyn49_df2016-06_dt2016-06_tof2_groupdfdt", 
     "query" : { 
      "$query" : {}, 
      "$orderby" : { 
       "T#mp" : NumberLong(1), 
       "T#df" : NumberLong(1) 
      } 
     }, 
     "client" : "192.168.1.33:59925", 
     "numYields" : 0, 
     "locks" : { 
      "Global" : "r", 
      "Database" : "r" 
     }, 
     "waitingForLock" : true, 
     "lockStats" : { 
      "Global" : { 
       "acquireCount" : { 
        "r" : NumberLong(2) 
       } 
      }, 
      "Database" : { 
       "acquireCount" : { 
        "r" : NumberLong(1) 
       }, 
       "acquireWaitCount" : { 
        "r" : NumberLong(1) 
       }, 
       "timeAcquiringMicros" : { 
        "r" : NumberLong(16503737) 
       } 
      } 
     } 
    }, 
    { 
     "desc" : "conn135989", 
     "threadId" : "0x10d44443c0", 
     "connectionId" : 135989, 
     "opid" : 22719240, 
     "active" : false, 
     "op" : "query", 
     "ns" : "ctp._cf28_atmarakesz93_dfc-r_dtc-r_tof2_groupaf", 
     "query" : { 
      "$query" : {}, 
      "$orderby" : { 
       "T#mp" : NumberLong(1) 
      } 
     }, 
     "client" : "192.168.1.33:34367", 
     "numYields" : 0, 
     "locks" : { 
      "Global" : "r", 
      "Database" : "r" 
     }, 
     "waitingForLock" : true, 
     "lockStats" : { 
      "Global" : { 
       "acquireCount" : { 
        "r" : NumberLong(2) 
       } 
      }, 
      "Database" : { 
       "acquireCount" : { 
        "r" : NumberLong(1) 
       }, 
       "acquireWaitCount" : { 
        "r" : NumberLong(1) 
       }, 
       "timeAcquiringMicros" : { 
        "r" : NumberLong(4500947) 
       } 
      } 
     } 
    }, 
    { 
     "desc" : "conn135410", 
     "threadId" : "0x2d66220", 
     "connectionId" : 135410, 
     "opid" : 22717853, 
     "active" : true, 
     "secs_running" : 22, 
     "microsecs_running" : NumberLong(22406019), 
     "op" : "query", 
     "ns" : "ctp.$cmd", 
     "query" : { 
      "createIndexes" : "_cf71_df2016-07_dt2016-11_tof2_groupct", 
      "indexes" : [ 
       { 
        "key" : { 
         "expireAt" : 1 
        }, 
        "name" : "exAt", 
        "background" : true, 
        "expireAfterSeconds" : 0 
       } 
      ] 
     }, 
     "client" : "0.0.0.0:0", 
     "numYields" : 0, 
     "locks" : { 
      "Global" : "w", 
      "Database" : "W" 
     }, 
     "waitingForLock" : true, 
     "lockStats" : { 
      "Global" : { 
       "acquireCount" : { 
        "r" : NumberLong(376227), 
        "w" : NumberLong(15477) 
       } 
      }, 
      "Database" : { 
       "acquireCount" : { 
        "r" : NumberLong(180375), 
        "w" : NumberLong(15476), 
        "W" : NumberLong(1) 
       }, 
       "acquireWaitCount" : { 
        "W" : NumberLong(1) 
       }, 
       "timeAcquiringMicros" : { 
        "W" : NumberLong(22004935) 
       } 
      }, 
      "Collection" : { 
       "acquireCount" : { 
        "r" : NumberLong(180375), 
        "w" : NumberLong(15476) 
       } 
      } 
     } 
    }, 
    { 
     "desc" : "conn135961", 
     "threadId" : "0x10d4442b60", 
     "connectionId" : 135961, 
     "opid" : 22718537, 
     "active" : false, 
     "op" : "query", 
     "ns" : "ctp._cf5_atattawapiskat23_dfc-r_dtc-r_tof2_groupaf", 
     "query" : { 
      "$query" : {}, 
      "$orderby" : { 
       "T#mp" : NumberLong(1) 
      } 
     }, 
     "client" : "192.168.1.33:34029", 
     "numYields" : 0, 
     "locks" : { 
      "Global" : "r", 
      "Database" : "r" 
     }, 
     "waitingForLock" : true, 
     "lockStats" : { 
      "Global" : { 
       "acquireCount" : { 
        "r" : NumberLong(2) 
       } 
      }, 
      "Database" : { 
       "acquireCount" : { 
        "r" : NumberLong(1) 
       }, 
       "acquireWaitCount" : { 
        "r" : NumberLong(1) 
       }, 
       "timeAcquiringMicros" : { 
        "r" : NumberLong(15002978) 
       } 
      } 
     } 
    }, 
    { 
     "desc" : "conn135905", 
     "threadId" : "0xc3e5d6000", 
     "connectionId" : 135905, 
     "opid" : 22718186, 
     "active" : false, 
     "op" : "query", 
     "ns" : "ctp._afwarszawa123_atdubrownik61_df2016-08_dt2016-08_tof2_groupdfdt", 
     "query" : { 
      "$query" : {}, 
      "$orderby" : { 
       "T#mp" : NumberLong(1), 
       "T#df" : NumberLong(1) 
      } 
     }, 
     "client" : "192.168.1.33:33638", 
     "numYields" : 0, 
     "locks" : { 
      "Global" : "r", 
      "Database" : "r" 
     }, 
     "waitingForLock" : true, 
     "lockStats" : { 
      "Global" : { 
       "acquireCount" : { 
        "r" : NumberLong(2) 
       } 
      }, 
      "Database" : { 
       "acquireCount" : { 
        "r" : NumberLong(1) 
       }, 
       "acquireWaitCount" : { 
        "r" : NumberLong(1) 
       }, 
       "timeAcquiringMicros" : { 
        "r" : NumberLong(16503305) 
       } 
      } 
     } 
    } 
] 

db.serverStatus()["rocksdb"]; 

{ 
    "stats" : [ 
     "", 
     "** Compaction Stats [default] **", 
     "Level Files Size(MB) Score Read(GB) Rn(GB) Rnp1(GB) Write(GB) Wnew(GB) Moved(GB) W-Amp Rd(MB/s) Wr(MB/s) Comp(sec) Comp(cnt) Avg(sec) Stall(cnt) KeyIn KeyDrop", 
     "---------------------------------------------------------------------------------------------------------------------------------------------------------------------", 
     " L0  0/0  0.00 0.0  0.0  0.0  0.0  1.4  1.4  0.0 0.0  0.0 120.1  12  39 0.312   0  0  0", 
     " L4  0/0  0.00 0.0  1.8  1.8  0.0  1.7  1.7  0.0 1.0 102.0  99.7  18  11 1.606   7  21M 153K", 
     " L5  15/0  620.47 1.0  6.6  1.4  5.2  5.5  0.3  0.0 3.9  44.4  37.0  152  25 6.086   0 110M 840K", 
     " L6 106/0 6401.43 0.0  3.5  0.3  3.3  3.3  -0.0  0.0 12.6  25.9  23.7  140   7 20.057   0 162M 14M", 
     " Sum 121/0 7021.90 0.0  11.9  3.4  8.5  11.9  3.4  0.0 8.3  37.8  37.8  322  82 3.932   7 295M 15M", 
     " Int  0/0  0.00 0.0  0.0  0.0  0.0  0.0  0.0  0.0 0.0  0.0  0.0   0   0 0.000   0  0  0", 
     "Flush(GB): cumulative 1.429, interval 0.000", 
     "Stalls(count): 0 level0_slowdown, 0 level0_slowdown_with_compaction, 0 level0_numfiles, 0 level0_numfiles_with_compaction, 0 pending_compaction_bytes, 0 memtable_compaction, 7 leveln_slowdown_soft, 0 leveln_slowdown_hard", 
     "", 
     "** DB Stats **", 
     "Uptime(secs): 34952.0 total, 0.2 interval", 
     "Cumulative writes: 4990K writes, 17M keys, 4989K batches, 1.0 writes per batch, ingest: 2.02 GB, 0.06 MB/s", 
     "Cumulative WAL: 4990K writes, 0 syncs, 4990122.00 writes per sync, written: 2.02 GB, 0.06 MB/s", 
     "Cumulative compaction: 11.90 GB write, 0.35 MB/s write, 11.90 GB read, 0.35 MB/s read, 322.4 seconds", 
     "Cumulative stall: 00:00:3.548 H:M:S, 0.0 percent", 
     "Interval writes: 0 writes, 0 keys, 0 batches, 0.0 writes per batch, ingest: 0.00 MB, 0.00 MB/s", 
     "Interval WAL: 0 writes, 0 syncs, 0.00 writes per sync, written: 0.00 MB, 0.00 MB/s", 
     "Interval compaction: 0.00 GB write, 0.00 MB/s write, 0.00 GB read, 0.00 MB/s read, 0.0 seconds", 
     "Interval stall: 00:00:0.000 H:M:S, 0.0 percent" 
    ], 
    "num-immutable-mem-table" : "0", 
    "mem-table-flush-pending" : "0", 
    "compaction-pending" : "0", 
    "background-errors" : "0", 
    "cur-size-active-mem-table" : "33MB", 
    "cur-size-all-mem-tables" : "33MB", 
    "num-entries-active-mem-table" : "185495", 
    "num-entries-imm-mem-tables" : "0", 
    "estimate-table-readers-mem" : "91MB", 
    "num-snapshots" : "1", 
    "oldest-snapshot-time" : "1465911051", 
    "num-live-versions" : "1", 
    "total-live-recovery-units" : 60, 
    "block-cache-usage" : "34GB", 
    "transaction-engine-keys" : NumberLong(4210), 
    "transaction-engine-snapshots" : NumberLong(1), 
    "thread-status" : [] 
} 

db.serverStatus()['globalLock']; 

{ 
    "totalTime" : NumberLong(34952090000), 
    "currentQueue" : { 
     "total" : 57, 
     "readers" : 56, 
     "writers" : 1 
    }, 
    "activeClients" : { 
     "total" : 124, 
     "readers" : 57, 
     "writers" : 1 
    } 
} 

그리고 화면 : 여기

어떤 순간부터 동결의 로그입니다

최고 감사의 말씀

+0

생성 된 모음의 크기는 얼마입니까? 같은 순간에 색인이 생성됩니까? – profesor79

+0

내 소식에서이 정보를 업데이트했습니다. – Kenny6

답변

1

새 컬렉션을 만드는 데는 아무런 의미가 없습니다. 엔지니어링 결함입니다. 이 컬렉션의 양은 사용 가능한 컬렉션 목록을 탐색하고 목록에 컬렉션 존재 여부를 확인해야하므로 db 서버를 고정시킵니다. 또한 메타 데이터 업데이트와 같은 일부 작업이 관련되어 있다고 생각합니다. 작업에서

는 인덱스를 구축하는 것은 창조 새 네임 스페이스 및 인덱스 구축에 필요한

"query" : { 
     "createIndexes" : "_cf71_df2016-07_dt2016-11_tof2_groupct", 
     "indexes" : [ 
      { 
       "key" : { 
        "expireAt" : 1 
       }, 
       "name" : "exAt", 
       "background" : true, 
       "expireAfterSeconds" : 0 
      } 
     ] 
    } 

는 또한, 획득 잠금 장치 같은 것들이 시간이 걸릴 상당한 시간을, 소요 분명 점점 로그인합니다. "expireAfterSeconds" : 0 같은 매개 변수도 이와 같은 규모에서는 현명하지 않습니다. 기본적으로 만료 된 레코드를 찾아서 제거하고 인덱스가 재구성되는지 확인하기 위해 매 60 초마다 1.4M 타이머를 실행해야합니다 (mongostat에서 이러한 삭제 참조).

배치 수를 줄이거 나 배치간에 모음을 나누는 방법을 고려하십시오. 또한 비활성 콜렉션의 색인을 삭제할 수 있습니다. 또한 사용하지 않은 모든 빈 & 컬렉션을 삭제하는 것이 좋습니다.

즉각적인 해결을 위해서는 RAM, CPU 또는 IOpS와 같은 현재 병목 현상을 찾아야합니다. 여분의 RAM이있어서 MongoDB에 줄 수 있으므로 더 많은 캐시를하고 불필요한 읽기를 피할 수 있습니다. 드라이브가 얼마나 바쁜지 알아 보려면 iostat을 통해 IOpS를 측정하십시오.