Comments (8)
Victor looked into this but couldn't figure it out.
- There is no 40ms lag on OS X
- There is no 40ms lag when opening a pipe
- There is a 40ms lag when re-using a pipe
- resource-pool and System.IO.Pool have no effect
- The delay is not caused by CPU usage, but by blocking
from mongodb.
I just tested that Openning many connections and using resource-pool to manage them to insert records concurrently would reduce the overall latence. In fact with 100 connections in a pool, the running to reduce from 40s to 0.7s.
from mongodb.
If you open a new connection, you don't see the 40ms delay. So you should save 4 seconds. Timings are machine dependent though. Yours may be a little slower.
from mongodb.
Hello,
Is there any news about the performance issues?
I'm currently trying to build some simple read-only web service on top of a MongoDB database but the response times are really bad.
I tried some benchmarking : https://gist.github.com/Herzult/56226dd23d8692d5ac88
from mongodb.
no news. You could check to see if anything improves with 7.10
from mongodb.
I noticed that the driver is much faster when we don't reuse the existing connection to the database. Here is an example:
This code is faster:
forM_ docs $ \doc -> do
pipe <- M.connect (M.host "127.0.0.1")
vid <- M.access pipe M.master "mongodb-haskell-test" $ M.insert "bigCollection" doc
putStrLn $ show vid
M.close pipe
Than this code:
pipe <- M.connect (M.host "127.0.0.1")
forM_ docs $ \doc -> do
vid <- M.access pipe M.master "mongodb-haskell-test" $ M.insert "bigCollection" doc
putStrLn $ show vid
M.close pipe
The first code takes only 2 sec to run. The second piece of code takes up to 4 minutes to run.
I'm researching this issue.
from mongodb.
Another piece of finding is that unconfirmed writes are much faster(thank you cap) even when we reuse the same connection. So, since unconfirmed writes and confirmed writes one per connection are much faster than many confirmed writes with one connection I can conclude that something is wrong with the queue of replies. Looking further into it...
from mongodb.
I'm marking this issue as resolved.
from mongodb.
Related Issues (20)
- Issues connecting to Mongo Atlas HOT 6
- Status of sharded connection support HOT 1
- ReplicaSet & Reused pipes HOT 1
- Replace depriciated opCodes with OP_MSG and update associated wire protocol. HOT 2
- Implementation or documentation issue: How to use '$inc'? HOT 1
- Documentation on best practices with Pipe HOT 8
- Allow TLS ClientParams to be provided to Transport.TLS (connect) HOT 1
- Modify does not return an error on duplicate key HOT 1
- Empty results from MongoDB Atlas (no document returned) HOT 19
- openReplicaSetSRV docs `unless (not is_auth)` incorrect HOT 2
- How to clamp while decrementing
- Support mongodb 6.0 ? HOT 2
- Update master/slave to primary/secondary
- Implement CI
- `MonadFail` not in scope when building on GHC 8.4 HOT 7
- doesn't work on MongoDB 6.0 HOT 7
- mongo 6: cannot request a collection with a dot (".") in its name
- Can't connect to atlas HOT 19
- Auth not working in newer than 5.x MongoDB HOT 7
- Issue with OP_MSG when cursor_id overflow 32bits
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mongodb.