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

HTTP connections are not being reused in single threaded application #112

Open
meschbach opened this issue Oct 11, 2015 · 1 comment
Open

Comments

@meschbach
Copy link

While processing a large number of documents ( >40K) quickly with a single threaded application on ruby 2.2.3 the pool of ephemeral ports was exhausted. From my analysis a new connection appears to be created for each request to the Couch instance, leaving a large number of sockets in TIME_WAIT under Linux. After reading through CouchRest and HTTPClient I couldn't find any options or code to deal with KeepAlive or Pipe Lining. Did I overlook an option in the documentation?

@samlown
Copy link
Member

samlown commented Jan 8, 2016

@meschbach just catching up with this. I'm assuming you're using the beta release of couchrest with httpclient? If so, how are you performing the requests?

The HTTP connections should be handled by the HTTPClient library, but it does require that you use a shared database object, i.e.:

server = CouchRest.new
db = server.database!('testdb')
db.get("SOMEID")

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