3

I have a very write intensive application that I want to optimize. Additionally I don't care about losing data in a crash, as long as there is no corruption in the existing ones.

Is it safe to run with journal disabled in this case? What other options do I have to increase insert performance?

1 Answer 1

0

Option 1: Set up a sharded cluster to distribute writes. However a sharded cluster brings complexity in terms of additional components needed (mongos, config servers, multiple replica sets, etc), along with technological overhead you'll need to deal with (balancer, chunk migration, no point-in-time backup/restore, etc).

Option 2: Set default writeConcern to 0, a.k.a. 'fire and forget' mode. Read more here. Basically, your application writes to mongod process (mongod in Primary, if you use a replica set), and receive no acknowledgement back. Two ways to use writeConcern:

  1. Set as default across replica set
  2. Use writeConcern per query

Read more about it here.

4
  • A sharded cluster is not an option at the moment but setting write concern to 0 looks promising. Batching inserts also has a big positive impact. Any comments about disabling the journal?
    – Nick Keets
    Commented Jun 11, 2014 at 3:41
  • Disable journaling would relieve stress on disk writes, but would not improve insert performance. Journaling is turned on as default since v2.0, to protect against data loss. Read this regard disable journaling:
    – Howard Lee
    Commented Jun 18, 2014 at 21:07
  • dba.stackexchange.com/questions/49306/…
    – Howard Lee
    Commented Jun 18, 2014 at 21:07
  • And also, consider replacing hard disk with SSD. You will see significant improvement even with w:1 j:1 (writeConcern set at 'acknowledged' and journaling enabled). blog.serverdensity.com/mongodb-benchmarks
    – Howard Lee
    Commented Jun 18, 2014 at 21:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.