Coder Social home page Coder Social logo

Comments (3)

wbolster avatar wbolster commented on September 16, 2024

The Batch.send() method is just the one that actually sends the data to the Thrift server, hence it takes the most time (but it is I/O bound). With your approach all ingestion into HBase happens from a single Thrift server, which in turn has to communicate with all the region servers to actually store the data (which in turn trigger HDFS replication traffic). This is obviously slower than ingesting bulk data from within the cluster itself, as is the case with the MapReduce job, since in that case the work will be actually distributed over the cluster.

Have you tried running multiple Thrift servers and using multiple connections, i.e. multiple HappyBase Connection instances to different remote hosts? Of course the splitting/chunking would move to your Python code in that case. The multiprocessing module (especially .imap_unordered() with an appropriate chunk size) may help you here.

from happybase.

arapat avatar arapat commented on September 16, 2024

Thank you very much for your help. Your suggestion works. It performs much better and takes ~ 15 minutes to write all the data with multiple Thrift servers.

Another optimization we can try is to pre-create the regions (reference: http://hbase.apache.org/book/perf.writing.html). I didn't find any API in happybase for creating regions, so I used HBase shell instead. Then it only takes less than 4 minutes to write all the data.

Your work makes our life much easier. Thanks again.

from happybase.

wbolster avatar wbolster commented on September 16, 2024

Great, glad to hear. As far as I know there is no way to create regions using the Thrift API, so it seems you'll have to use the HBase shell for that.

from happybase.

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.