4
回答
Linux下mongodb 插入很慢 数据才几十W CPU占用很高
【腾讯云】学生服务器套餐10元/月 >>>   

表sample存储样例: 

/* 0 */
{
  "098f6bcd4621d373cade4e832627b4f6a94a8fe5ccb19ba61c4c0873d391e987982fbbd3" : {
    "Comment" : "",
    "Md5" : "098f6bcd4621d373cade4e832627b4f6",
    "Sha1" : "a94a8fe5ccb19ba61c4c0873d391e987982fbbd3",
    "Size" : 4,
    "StoreProvider" : {
      "servicer" : "mycos",
      "burket" : "test",
      "path" : "/2014/0415/0/098f6bcd4621d373cade4e832627b4f6a94a8fe5ccb19ba61c4c0873d391e987982fbbd3"
    },
    "UploadStatus" : "Uploaded",
    "UploadUser" : "testUserKey",
    "UploadedTime" : "1397532363",
    "uploadedStartTime" : "1397532362"
  },
  "_id" : ObjectId("534ca6ca8bf6020caa2ec6a0")
}

表md5Sample存储样例:

/* 0 */
{
  "_id" : ObjectId("534ca6ca8bf6020caa2ec69e"),
  "098f6bcd4621d373cade4e832627b4f6" : {
    "098f6bcd4621d373cade4e832627b4f6a94a8fe5ccb19ba61c4c0873d391e987982fbbd3" : "a94a8fe5ccb19ba61c4c0873d391e987982fbbd3"
  }
}

表sha1Sample存储样例:

/* 0 */
{
  "_id" : ObjectId("534ca6ca8bf6020caa2ec69f"),
  "a94a8fe5ccb19ba61c4c0873d391e987982fbbd3" : {
    "098f6bcd4621d373cade4e832627b4f6a94a8fe5ccb19ba61c4c0873d391e987982fbbd3" : "098f6bcd4621d373cade4e832627b4f6"
  }
}

========================================================

不知道是什么原因导致插入性能很低,昨天在VMware虚拟机中测试写入7W多数据 花了6个小时,写入时CPU资源占用也很高,在真机中测试 性能也比较低,为何会这样?表结构设计有问题吗?

举报
西门飞
发帖于4年前 4回/2K+阅
顶部