one socket opened per send
Reported by geir | December 30th, 2008 @ 12:25 PM
It seems that couchrest opens one socket per send. The program :
require 'couchrest'
def save(n) couch = CouchRest.new("http://localhost:5984") db = couch.database('geirtest') n.times { db.save({ "name" => "geir" }) } end
t1 = Time.now
thread1 = Thread.new{save(100)} thread1.join
t2 = Time.now
puts t2 - t1
opens lots of sockets.
1) Am I interpreting things right?
2) Can there be a mode where the library takes advantage of keepalive to avoid the socket creation overhead?
Forgive my crappy ruby code.
Comments and changes to this ticket
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
"CouchDB, close to the metal." CouchRest is a RESTful layer for accessing CouchDB, based off CouchDB's included Javascript reference client. CouchRest also includes helpers for running large queries etc. There is also a base class for ActiveRecord / Datamapper style ORM, called CouchRest::Model.
