1

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 ?

DhruvPathak
  • 42,059
  • 16
  • 116
  • 175

2 Answers2

4

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");
Justin Jenkins
  • 26,590
  • 6
  • 68
  • 1,285
  • Thanks, I had verbose version of logging which was logging an abridged form of all queuries, will try now with quiet option. Will tell you if there is any improvement. – DhruvPathak Apr 18 '11 at 06:27
  • just curious..would VERBOSE form of loggin be a blocker in anyway ? – DhruvPathak Apr 18 '11 at 06:29
  • @DhruvPathak it shouldn't out-right **block** but under heavy load, it might up I/O use for example, therefore increasing load ... but personally I haven't run into an issue. – Justin Jenkins Apr 18 '11 at 06:52
  • I don't know which kid did that, I had upvoted your answer :) – DhruvPathak Apr 19 '11 at 05:47
0

"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.