Giter Club home page Giter Club logo

Comments (8)

gregwebs avatar gregwebs commented on August 25, 2024

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.

hwa avatar hwa commented on August 25, 2024

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.

gregwebs avatar gregwebs commented on August 25, 2024

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.

Herzult avatar Herzult commented on August 25, 2024

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.

gregwebs avatar gregwebs commented on August 25, 2024

no news. You could check to see if anything improves with 7.10

from mongodb.

VictorDenisov avatar VictorDenisov commented on August 25, 2024

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.

VictorDenisov avatar VictorDenisov commented on August 25, 2024

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.

VictorDenisov avatar VictorDenisov commented on August 25, 2024

I'm marking this issue as resolved.

from mongodb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.