Mongo 4 faster than Mongo 7?

Hey!
Any possibility mongo 4 is faster than Mongo 7?

Situation: in my local dev macos system I have mongo 7 installed via brew and mongo 4 via run-rs tool. I have a web-app with bunch of tests, using Mongo replicaset(localhost). So, problem is - if I start replica via brew (mongo 7) even with only one memeber these tests run 2-3 times slower(!) than if I use default run-rs replica (localhost 20017, 20018, 20019). My tests using updates, deletes, queries, transactions if it important.

I repoduse it many times and the output always the same - run-rs replica mongo ver4 with 3 memebers faster.

Why is that? Is it case of Mongo or some options and tweaks of run-rs config?

1 Like

@Alex_Kotomin As far as I know, mmapv1 engine (available earlier than v4.2) engine is faster than WiredTiger engine because the architecture is very simple at taking a risk of database file crash.
Even if it is that, in my performance tests (shell based simple 1000 commands running test), v4 and v5 seems they are 2 ~ 30 times faster than v6 and v7. I’m also in trouble thinking about it.

1 Like

thank you! I guess we can live with it =)

1 Like

Hey @Alex_Kotomin,

Welcome to the MongoDB Community!

Could you please provide more specific details about the version (such as 4.0.x) you’re using and the deployment configuration of both versions you have in place?

Based on the above information, it seems like you’re comparing a MongoDB v7.0 standalone instance with a MongoDB v4.0 3-member replica set. May I ask if there’s a specific reason for this particular comparison?

It appears to me that the comparison is not entirely balanced or equivalent in terms of the deployment configurations being considered. Therefore, I suggest that you test both versions by running them with run-rs.

However, it would be helpful if you could share more insights into your use case and the workflow you’re following. Additionally, please specify the language drivers and its version that you are testing with, and let us know whether you are using the same code to run these tests. This information will help us to assist you better.

Looking forward to your response.

Best regards,
Kushagra

1 Like

Hey!

There were no comparison, I just have to use replicaSet to use transaction. So i download run-rs and just start it with defaults (ver 4.0.12, 3 replicaset members).

Everything was OK, but I decided to use latest version of Mongo and download it with brew. When I start it with replicaSet option and has 3 members too, I suddenly see my test slow down 2-3 times. I was suprprised by that, and start to look for reason, try to use only 1 memeber for example (27017), but it were still slower than run-rs.

I use Elixir, mongodb-driver 1.0.3, tests are the same -no differs there, before tests there are collections and indexes creating, but not during the tests. Before some db tests clearing of some collections happen deleteMany()

I tried that u asked for -download 7.0.1 version via run-rs

this is run-rs mongo version 4.0.12
(run-rs -h 127.0.0.1 --dbpath '/opt/homebrew/var/mongodb' --keep)
Finished in 2.4 seconds (1.0s async, 1.4s sync)
473 tests, 0 failures


Here is run-rs with 7.0.1
(run-rs -v 7.0.1 -h 127.0.0.1)
Finished in 17.8 seconds (2.4s async, 15.4s sync)
473 tests, 0 failures

By now it is not problem for me, I just curious. By the way, on my windows 10 desktop same tests run with the same high speed as run-rs but has latest Mongo there (no run-rs on Windows).

1 Like

@Kushagra_Kesav Thanks for all of your contribution to MongoDB and for this response to us :slightly_smiling_face:
It’s not just a curious for me. I have been insterested in MongoDB for a long time (since 2011) and I’m using MongoDB v4.0 with configuration engine mmapv1 in several subsystems for my reserch environment. I think one of the characteristics of document-based database systems is the agility of data manipulation for large amounts of data.
So, I’d like to know why a simple operation like the one @Alex_Kotomin tried works slower in the latest version of MongoDB than in previous versions.

Could be related to the write concern. IIRR since v6 ‘majority’ is the new default.

  • Jens