Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maintain Thrift Connection between Requests #17

Closed
gummoe opened this issue Mar 26, 2014 · 3 comments
Closed

Maintain Thrift Connection between Requests #17

gummoe opened this issue Mar 26, 2014 · 3 comments

Comments

@gummoe
Copy link

gummoe commented Mar 26, 2014

There may already be a way to accomplish this, but I was hoping there may be a way to maintain connection to a remote Thrift server in-between requests. We're developing a RESTful API to provide basic reads of our HBase cluster, but are experiencing slow response times because (we think) a new connection is established for each read. Are you able to recommend a solution to this?

I envision this solution looking similar to the massive_record gem or active_record approach.

@nkeyes
Copy link
Owner

nkeyes commented Mar 26, 2014

Yeah, you definitely don't want to instantiate a new thrift connection on every request. You should create the connection and memoize/cache it somehow; in an initializer or as a class variable, etc.
Did you see this comment from a previous issue?
#15 (comment)

@gummoe
Copy link
Author

gummoe commented Mar 26, 2014

I didn't, no. This is exactly what I was looking for. I appreciate your
help! Thanks for working on this awesome gem.

Benjamin Gummoe | 612.217.2280

On Tue, Mar 25, 2014 at 9:52 PM, Nathan Keyes notifications@github.comwrote:

Yeah, you definitely don't want to instantiate a new thrift connection on
every request. You should create the connection and memoize/cache it
somehow; in an initializer or as a class variable, etc.
Did you see this comment from a previous issue?
#15 (comment)#15 (comment)

Reply to this email directly or view it on GitHubhttps://github.com//issues/17#issuecomment-38642483
.

@nkeyes
Copy link
Owner

nkeyes commented Mar 26, 2014

No problem, I'm glad it's useful.

@nkeyes nkeyes closed this as completed Mar 26, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants