incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ruy Díaz Jara" <diaz...@gmail.com>
Subject Re: Connection reset
Date Thu, 18 Dec 2008 19:24:17 GMT
I'm using Ruby for my app and using Sequel gem for the DB access. For
CouchDB however, I'm just using the Sequel::ConnectionPool class to take
care of the pooling. I create an instance of ConnectionPool and then set the
connection_proc attribute to a proc that instantiates my HTTP client with
the open socket.

require 'sequel'
connection_pool = Sequel::ConnectionPool.new( :max_connections=>10 )
connection_pool = proc {
  Net::HTTP.start( host, port )
}

connection_pool.hold{ |http|
     http.send_request( 'PUT', '/foo/a', "name='bob'", { "content-type" =>
'application/json' })
}


Hope this helps.
Ruy


On Thu, Dec 18, 2008 at 11:04 AM, paul jobs <webjogger@gmail.com> wrote:

> can you share how to use pools or DButils pool with couchdb
> thanks
>
> On Thu, Dec 18, 2008 at 10:51 AM, Ruy Díaz Jara <diazruy@gmail.com> wrote:
>
> > Hi,
> >
> > I've recently been working on getting my application to use a connection
> > pool to connect to Couch and improve performance by reusing the
> connections
> > and avoiding the socket opening/closing cost. Everything seems nice and
> > dandy except when I create a new database. Apparently every time I create
> a
> > DB, the socket is closed by Couch. Does anyone know if this expected
> > behaviour and if so what the rationale behind it is?
> >
> > With all other operations this does not occur. It's not even the PUT
> action
> > (I can put documents in the DB repeatedly reusing the socket). It seems
> to
> > be only when DBs are created.
> >
> > Thanks
> > Ruy
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message