Giter Club home page Giter Club logo

Comments (5)

jeromew avatar jeromew commented on September 16, 2024

can I ask what you mean by "table with no keys" ? do you mean "empty table" vs "non empty table" ?

from node-pg-copy-streams.

ablaszkiewicz avatar ablaszkiewicz commented on September 16, 2024

You know what. It was obviously problem with my implementation. I was opening multiple streams but only from one client and I suspect one had to wait for another to finish and this is why data couldn't "flow" through the system

from node-pg-copy-streams.

jeromew avatar jeromew commented on September 16, 2024

ok thanks for closing this. you may still want to dig into why so much data gets buffered. I suspect you have a problem (or maybe this is a choice) with your sources not respecting the backpressure protocol (a source should stop writing into a sink when sink.write returns false)

from node-pg-copy-streams.

ablaszkiewicz avatar ablaszkiewicz commented on September 16, 2024

I know what was causing this. I only had one stream (green) opened at the same time and it was causing yellow and red to be stuck in between:
image

Other streams had to wait until the green stream can end (and green had to wait for readStream to end) and only then other streams opened - that is why there was such a big delay between readStream.on('end') and writeStream.on('finish').

My previous implementation used same PoolClient to instantiate all 3 streams and this is why this happened. New implementation uses 3 different instances of PoolClient to instantiate 3 streams, so now data can flow freely without waiting for other streams to finish:
image

And the time difference between tables was caused by the order of instantiating streams. I was getting really low times when writing only to green and really high times when writing to others

from node-pg-copy-streams.

jeromew avatar jeromew commented on September 16, 2024

ok. good job figuring that out !

from node-pg-copy-streams.

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.