DhruvPathak
DhruvPathak

Reputation: 43245

Does logging output to an output file affect mongoDB performance?

MongoDB outputs to a file speficied in command line parameters when it is started. My question is : is that log writing a blocking operation ? Does it write previous operation to log before executing the next one ? Will disabling logging enhance the performance of a write heavy setup in anyway ?

Upvotes: 1

Views: 952

Answers (2)

user2665694
user2665694

Reputation:

"Will disabling logging enhance the performance of a write heavy setup in anyway ?"

Standard answer: measure it

Extensive logging with any backend component under heavy load can be a bottleneck - this is a known wisdom applying to every database etc.

Upvotes: 0

Justin Jenkins
Justin Jenkins

Reputation: 27080

As far as I know ... No, the normal "log" does not block ... it's not a log of actual operations on the database, but rather connections, errors, etc.

I'm not even aware of a way to turn this off (though you can make it less "verbose" by starting MongoDB with --quiet)

This is of course seperate from logging for Journaling purposese ... but again, this is designed to not have blocking issues ...

"Read performance should be the same. Write performance should be very good but there is some overhead over the non-durable version as the journal files must be written."

I've run MongoDB with a lot of writes, and I haven't had any issues with logging. I would however suggest "rotating" your logs regularly ...

> db.runCommand("logRotate");

Upvotes: 4

Related Questions