[GODRIVER-799] Low performance compared with the community driver Created: 31/Jan/19  Updated: 16/Nov/21  Resolved: 11/Jul/20

Status: Closed
Project: Go Driver
Component/s: Performance
Affects Version/s: 0.2.0
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: edward Marinescu Assignee: Unassigned
Resolution: Done Votes: 0
Labels: benchmark
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Windows 10 pro, mongodb 4.0.5 Community, go1.11.5


Attachments: JPEG File mongodb-new-vs-old.JPG    
Issue Links:
Related
related to TOOLS-2240 Performance test mgo vs mongo-go-driver Closed

 Description   

I had been using the [community golang driver |github.com/globalsign/mgo] for the past 2 years, and recenly I've decided to try the official driver fo golang since it went in beta.

Everything worked fine, but of course I was very curious how it performs in terms of speed with the old driver and I was pretty disappointed.

I have a 30 million documents collection for testing purposes, and for this test I've selected a single document by _id and I've used bombardier to do 10000 requests with 100 request concurrency.

The results are:

  • Official MongoDb driver: ~ 10k req/second
  • Community MongoDb driver: ~ 20k req/second

Any thoughts?



 Comments   
Comment by Jeffrey Yemin [ 11/Jul/20 ]

Thanks for the confirmation. I'm going to close this issue now.

Comment by edward Marinescu [ 11/Jul/20 ]

jeff.yemin sorry for the late reply, I just tested now and yes I confirm that the official driver is now a little faster than the old community driver.

Thanks, you can close now this issue.

Comment by Jeffrey Yemin [ 10/Oct/19 ]

speedwheel would you like to verify these results before we close this issue?

Comment by Robbert Kauffman [ 10/Oct/19 ]

Reran the test with latest mongodb-go-driver. Speed with the official driver seems to now be better than with globalsign/mgo:

 

community-driver:
Robberts-MacBook-Pro:go rkauffmanmongo$ bombardier -n 10000 -c 100 localhost:8080/api/store/cars/5c5227e2fe5d37009859ac9f
Bombarding http://localhost:8080/api/store/cars/5c5227e2fe5d37009859ac9f with 10000 request(s) using 100 connection(s)
 10000 / 10000 [==============================================================================================] 100.00% 16606/s 0s
Done!
Statistics        Avg      Stdev        Max
  Reqs/sec     23899.22    5247.49   29691.85
  Latency        4.18ms     2.43ms    40.34ms
  HTTP codes:
    1xx - 0, 2xx - 10000, 3xx - 0, 4xx - 0, 5xx - 0
    others - 0
  Throughput:     5.11MB/s
 
official-driver:
Robberts-MacBook-Pro:go rkauffmanmongo$ bombardier -n 10000 -c 100 localhost:8080/api/store/cars/5c5227e2fe5d37009859ac9f
Bombarding http://localhost:8080/api/store/cars/5c5227e2fe5d37009859ac9f with 10000 request(s) using 100 connection(s)
 10000 / 10000 [==============================================================================================] 100.00% 24720/s 0s
Done!
Statistics        Avg      Stdev        Max
  Reqs/sec     26470.43    6389.86   40467.18
  Latency        3.85ms     2.54ms    39.56ms
  HTTP codes:
    1xx - 0, 2xx - 0, 3xx - 0, 4xx - 10000, 5xx - 0
    others - 0
  Throughput:     5.74MB/s

jeff.yemin: I think this issue can be resolved and closed, unless you'd like to verify yourself.

 

Comment by Ian Whalen (Inactive) [ 06/May/19 ]

Given that a huge swath of the core library code is changing in the next few weeks (and that's where most of the work is happening right now), we believe the best here is to pause any investigation until the bulk of work tracked in GODRIVER-617 is complete and then come back to do further analysis.

Comment by edward Marinescu [ 31/Jan/19 ]

Hello Jeff,

Yes, of course, I created a repository here: https://github.com/speedwheel/golang-mongodb-official-vs-community-drivers.

I've also added a sample of document that I am using, the performance is the same if testing with 1 document in the database or 30 million documents.

Comment by Jeffrey Yemin [ 31/Jan/19 ]

Hi speedwheel,

Can you post your benchmark code? It's difficult to come to any conclusions without seeing exactly what you're doing.

Generated at Thu Feb 08 08:35:00 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.