com.Mongodb.Reponse.java中的Mongodb慢速调用
我有一个3节点的复制集,在进行性能测试时,我看到很多对mongo的调用都很慢 日志中没有慢速查询,mms控制台不会向我指出任何内容(没有页面错误、索引未命中、cpu、内存)。通过对应用程序的分析,我看到下面一行中的所有调用都很慢com.Mongodb.Reponse.java中的Mongodb慢速调用,mongodb,mongodb-query,Mongodb,Mongodb Query,我有一个3节点的复制集,在进行性能测试时,我看到很多对mongo的调用都很慢 日志中没有慢速查询,mms控制台不会向我指出任何内容(没有页面错误、索引未命中、cpu、内存)。通过对应用程序的分析,我看到下面一行中的所有调用都很慢 CommonRepositoryImpl.aggregate:242 (0ms self time, 5856 ms total time) MongoTemplate.execute:402 (
CommonRepositoryImpl.aggregate:242 (0ms self time, 5856 ms total time)
MongoTemplate.execute:402 (0ms self time, 5856 ms total time)
CommonRepositoryImpl$3.doInCollection:243 (0ms self time, 5856 ms total time)
CommonRepositoryImpl$3.doInCollection:248 (0ms self time, 5856 ms total time)
DBCollection.aggregate:1307 (0ms self time, 5856 ms total time)
DB.command:244 (0ms self time, 5856 ms total time)
DB.command:262 (0ms self time, 5856 ms total time)
DBApiLayer$MyCollection.__find:288 (0ms self time, 5856 ms total time)
DBTCPConnector.call:216 (0ms self time, 5856 ms total time)
DBTCPConnector.innerCall:244 (0ms self time, 5856 ms total time)
DBPort.call:92 (0ms self time, 5856 ms total time)
DBPort.go:142 (0ms self time, 5856 ms total time)
Response.<init>:40 (5856ms self time, 5856 ms total time)
我不知道如何解释这一点,也不知道是什么原因导致了速度缓慢,任何关于什么可能导致速度缓慢的线索都会有很大帮助
rs_default:PRIMARY> db.stats()
{
"db" : "xrr",
"collections" : 5,
"objects" : 784576,
"avgObjSize" : 2757.876167509585,
"dataSize" : 2163763452,
"storageSize" : 2698293248,
"numExtents" : 49,
"indexes" : 64,
"indexSize" : 791019824,
"fileSize" : 6373244928,
"nsSizeMB" : 16,
"dataFileVersion" : {
"major" : 4,
"minor" : 5
},
"ok" : 1
}
db.VehicleReview.stats()
{
"ns" : "xrr.VehicleReview",
"count" : 399933,
"size" : 1264702320,
"avgObjSize" : 3162.285482818372,
"storageSize" : 1476620288,
"numExtents" : 19,
"nindexes" : 39,
"lastExtentSize" : 386654208,
"paddingFactor" : 1.0180000000000002,
"systemFlags" : 1,
"userFlags" : 0,
"totalIndexSize" : 542395840,
"indexSizes" : {
"_id_" : 10277232,
"make_model_year_averageRating_index" : 19319888,
"submodel_id_index" : 10072832,
"target_id_index" : 10522512,
"model" : 9909312,
"year" : 8870960,
"legacyId" : 6851488,
"author_name_index" : 10473456,
"author_email_index" : 15550752,
"ip_address_index" : 7644560,
"make" : 9745792,
"moderationStatus" : 12640096,
"created" : 10072832,
"model_make_year_status_index" : 21911680,
"model_make_year_status_created_index" : 25607232,
"submodel_id_status_created_index" : 19982144,
"style_id_status_created_index" : 20431824,
"make_status_index" : 15984080,
"model_year_make_created_status_index" : 25599056,
"submodel_id_created_status_index" : 19982144,
"style_id_created_status_index" : 20431824,
"comment_moderationStatus_index" : 6990480,
"make_comment_status_index" : 10285408,
"comment_authorName_index" : 7023184,
"comment_authorEmail_index" : 7227584,
"comment_ipAddress_index" : 7072240,
"comment_created_index" : 7031360,
"make_model_year_identifier_target_id_index" : 22827392,
"make_model_year_identifier_target_id_created_status_index" : 32842992,
"make_model_year_identifier_index" : 18706688,
"make_model_year_identifier_created_status_index" : 28689584,
"comment_id_index" : 384272,
"comment_updated_index" : 310688,
"updated" : 7309344,
"duplicateSearchSignature" : 6859664,
"author_name_created_status_index" : 20366416,
"sentinel_conclusion_moderation_status_index" : 13089776,
"created_moderation_status_sentinel_conclusion_index" : 16736272,
"moderation_status_sentinel_conclusion_created_index" : 16760800
},
"ok" : 1
}
谢谢,
Suresh请向我们提供一些信息。添加
db.collection.stats()
,db.stats()
,db.collection.getIndexes()
的输出和聚合查询代码。感谢您的回复,正如我所说,我没有看到查询遗漏索引,也没有看到查询本身从慢速日志中变慢。该调用在其他一些集成环境中也可以正常工作,这更像是网络问题或其他问题请激活数据库的评测。我认为这是一个数据库问题。成员有多少内存?
rs_default:PRIMARY> db.stats()
{
"db" : "xrr",
"collections" : 5,
"objects" : 784576,
"avgObjSize" : 2757.876167509585,
"dataSize" : 2163763452,
"storageSize" : 2698293248,
"numExtents" : 49,
"indexes" : 64,
"indexSize" : 791019824,
"fileSize" : 6373244928,
"nsSizeMB" : 16,
"dataFileVersion" : {
"major" : 4,
"minor" : 5
},
"ok" : 1
}
db.VehicleReview.stats()
{
"ns" : "xrr.VehicleReview",
"count" : 399933,
"size" : 1264702320,
"avgObjSize" : 3162.285482818372,
"storageSize" : 1476620288,
"numExtents" : 19,
"nindexes" : 39,
"lastExtentSize" : 386654208,
"paddingFactor" : 1.0180000000000002,
"systemFlags" : 1,
"userFlags" : 0,
"totalIndexSize" : 542395840,
"indexSizes" : {
"_id_" : 10277232,
"make_model_year_averageRating_index" : 19319888,
"submodel_id_index" : 10072832,
"target_id_index" : 10522512,
"model" : 9909312,
"year" : 8870960,
"legacyId" : 6851488,
"author_name_index" : 10473456,
"author_email_index" : 15550752,
"ip_address_index" : 7644560,
"make" : 9745792,
"moderationStatus" : 12640096,
"created" : 10072832,
"model_make_year_status_index" : 21911680,
"model_make_year_status_created_index" : 25607232,
"submodel_id_status_created_index" : 19982144,
"style_id_status_created_index" : 20431824,
"make_status_index" : 15984080,
"model_year_make_created_status_index" : 25599056,
"submodel_id_created_status_index" : 19982144,
"style_id_created_status_index" : 20431824,
"comment_moderationStatus_index" : 6990480,
"make_comment_status_index" : 10285408,
"comment_authorName_index" : 7023184,
"comment_authorEmail_index" : 7227584,
"comment_ipAddress_index" : 7072240,
"comment_created_index" : 7031360,
"make_model_year_identifier_target_id_index" : 22827392,
"make_model_year_identifier_target_id_created_status_index" : 32842992,
"make_model_year_identifier_index" : 18706688,
"make_model_year_identifier_created_status_index" : 28689584,
"comment_id_index" : 384272,
"comment_updated_index" : 310688,
"updated" : 7309344,
"duplicateSearchSignature" : 6859664,
"author_name_created_status_index" : 20366416,
"sentinel_conclusion_moderation_status_index" : 13089776,
"created_moderation_status_sentinel_conclusion_index" : 16736272,
"moderation_status_sentinel_conclusion_created_index" : 16760800
},
"ok" : 1
}