Re: syslog entry for each update query even with quiet=True and profiling disabled

93 views
Skip to first unread message

Stephen Steneker

unread,
Oct 6, 2012, 4:04:45 AM10/6/12
to mongod...@googlegroups.com

I am logging to syslog. It seems that almost every update is getting logged, e.g:

Oct  5 11:26:39 mongodb-b mongod.27017[24789]: Fri Oct  5 11:26:39 [conn182253] update Archive.PersonalStats query: { date: new Date(1349436221781), userid: 7749 } update: { $set: { medicalitemsused: 39.0 } } nscanned:1166 nupdated:1 keyUpdates:0 numYields: 9 locks(micros) w:13449 14411ms
Oct  5 11:26:39 mongodb-b mongod.27017[24789]: Fri Oct  5 11:26:39 [conn182256] update Archive.PersonalStats query: { date: new Date(1349436221781), userid: 7749 } update: { $set: { statenhancersused: 0.0 } } nscanned:1166 nmoved:1 nupdated:1 keyUpdates:0 numYields: 9 locks(micros) w:12617 14408ms
Oct  5 11:26:39 mongodb-b mongod.27017[24789]: Fri Oct  5 11:26:39 [conn182269] update Archive.PersonalStats query: { date: new Date(1349436221781), userid: 7749 } update: { $set: { refils: 0.0 } } nscanned:1166 nupdated:1 keyUpdates:0 numYields: 9 locks(micros) w:12851 14406ms
Oct  5 11:26:39 mongodb-b mongod.27017[24789]: Fri Oct  5 11:26:39 [conn182273] update Archive.PersonalStats query: { date: new Date(1349436221781), userid: 7749 } update: { $set: { trainsreceived: 41.0 } } nscanned:1166 nupdated:1 keyUpdates:0 numYields: 9 locks(micros) w:12089 14404ms

I have no idea why this is - these are tiny updates and the overhead of logging them will be far more than the overhead of executing the query! They also make my logs enormous. 

Can I disable them?

Hi Alex,

These are slow queries being logged (>slowms, which defaults to 100ms).  The examples you have included are ~14000ms (14s) and are scanning 1166 documents to update a single document.

You are possibly missing an index on { date:1, userid: 1}.

You can use the explain() command to look at index usage for a query:
 http://www.mongodb.org/display/DOCS/Explain

You can change the value of slowms if you have a different tolerance for acceptable query time, or look at filtering options for your version of syslog to suppress or redirect these messages.

Cheers,
Stephen
Reply all
Reply to author
Forward
0 new messages