Coder Social home page Coder Social logo

Comments (6)

wbolster avatar wbolster commented on August 13, 2024

Have you profiled your program to see where it spends the most time? cProfile or other profiling tools may help you here.

If it's inside your application's Python code, you might want to optimize that, and if that turns out not to be good enough, you may look into running multiple processes (e.g. using the multiprocessing module), since CPython only runs a single thread at a time (due to the GIL).

On the other hand, if most of the time is spent writing to sockets and waiting for server responses, threads or gevent (with monkey patching so that Thrift uses gevent-aware sockets) may be a better option.

So, the anwer to your question "is there a better way" is "it depends". :)

from happybase.

saintthor avatar saintthor commented on August 13, 2024

thank you.

from happybase.

wbolster avatar wbolster commented on August 13, 2024

Oh, and if you decide to use multiple threads or processes, running multiple Thrift servers on different nodes may also help increase performance. http://chase-seibert.github.io/blog/2013/05/24/why-you-should-not-write-your-own-load-balancer.html might be an interesting read in that case.

from happybase.

saintthor avatar saintthor commented on August 13, 2024

thanks. but i don't understand how to run multiple Thrift servers in one hadoop group.

from happybase.

wbolster avatar wbolster commented on August 13, 2024

Just run a Thrift server on each node.

from happybase.

saintthor avatar saintthor commented on August 13, 2024

thank you. it is wonderful.

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.