I found the reason. After i discovered that if i open a requests.Session
and perform requests from there, it became as slow as the couchdbkit
connection. The issue is that couchdb by default seems to delay TCP
replies on a http-1.1 persistent connection. Configuring couchdb like this:
[httpd]
socket_options = [{nodelay, true}]
makes couchdbkit indeed faster than requests.
On Mon, Dec 10, 2012 at 9:48 PM, Benoit Chesneau <[email protected]>wrote:
> Could you open a ticket anyway? It will be better to track all info.
>
> - benoît
>
>
> On Mon, Dec 10, 2012 at 9:47 PM, Benoit Chesneau <[email protected]
> >wrote:
>
> > So I launched the script and I got reversed results:
> >
> > $ python test.py
> > '0.795 duration -- couchdbkit: 500'
> > '2.064 duration -- requests: 500'
> >
> > Not sure what happen right now on your version. This is on ubuntu. I will
> > test on mac later.
> >
> > - benoit
> >
> >
> > On Mon, Dec 10, 2012 at 9:39 PM, Holger Krekel <[email protected]
> >wrote:
> >
> >> here is the r2.py script http://bpaste.net/show/tJCSgiFIY5AKDdLFuIoH/
> >>
> >> the timing is 20.5 seconds for couchdbkit and 1.06 seconds for requests.
> >>
> >> the server string is: 'CouchDB/1.2.0 (Erlang OTP/R15B02)'
> >>
> >>
> >> On Mon, Dec 10, 2012 at 9:35 PM, Benoit Chesneau <[email protected]
> >> >wrote:
> >>
> >> > On Mon, Dec 10, 2012 at 9:11 PM, Holger Krekel <
> [email protected]
> >> > >wrote:
> >> >
> >> > > Find attached the r2.py script - it assumes a couchdb server at port
> >> 8001
> >> > > but creates the doc (not a view anymore) itself before measuring the
> >> > speed
> >> > > of getting the doc 500 times.
> >> > >
> >> > >
> >> > >
> >> > Thanks but attachments won't work here :) Can you attach me to a
> >> ticket on
> >> > github ? Or just paste it somewhere.
> >> >
> >> > - benoît
> >> >
> >>
> >
> >
>