You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by John Cheng <jo...@gmail.com> on 2011/08/11 19:54:02 UTC

CouchDB performance

I published some Python scripts to help me evaluate the performance of
CouchDB (https://github.com/jlcheng/couchdb-test). I was hoping the folks
here can help me understand what I am seeing.

The raw spreadsheet of my findings:
https://spreadsheets0.google.com/spreadsheet/pub?hl=en_US&hl=en_US&key=0AtagEcs-wlFDdGVfMGItdUIxQXcyTmZxdVdOMUw4TWc&output=html

First, I've found that the Document Update Handler API performed worse than
using Python to get, modify, then update the document when the application
code is running on the same machine as CouchDB. This is surprising to me. It
leads me to believe that when the network is not a bottleneck, it might be
better to avoid update handers.

Second, the insert performance is not as good as I'd hoped - at least for
large documents (100 kB+). The update performance is even worse. When using
the "benchbulk.sh" script with a DOCSIZE of 100 kB and a BULKSIZE of 15, I
am seeing about 12 inserts per second. Using my Python script, I was seeing
81 inserts/second and 30 updates/seconds for 100 kB documents. This is on a
single 7200 rpm SATA drive. A write performance of 3 MB per second seems
low.

In brief, there are two things I can learn more about: Is is expected for
the Document Update API to be slower? Two, does this kind of write and
update performance look right?

This is a Ubunut 10.01 system with

4GB RAM
900GB 7200 rpm SATA drive
CouchDB 1.0.2 compiled using https://github.com/couchone/build-couchdb

And the stock CouchDB 0.10.0 from Ubuntu has similar performance as well.

Re: CouchDB performance

Posted by kowsik <ko...@gmail.com>.
Well, for nodelay (we set this to true on the blitz.io scale engines,
BTW) to be appreciable you need some kinda geo latency where the
buffering and the Nagle algorithm is recognizable. For local or really
fast networks, unless you are using an interactive client like SSH or
telnet (stop using that!), you are not going to see much of a
difference.

Thanks much and the blitz.io couch cluster is now running with this setting. :)

K.
---
http://blitz.io
@pcapr

On Tue, Aug 16, 2011 at 10:05 PM, Filipe David Manana
<fd...@apache.org> wrote:
> On Tue, Aug 16, 2011 at 9:48 PM, kowsik <ko...@gmail.com> wrote:
>> This is awesome. Didn't know about this setting. Is there a reason why
>> we don't set nodelay to true by default?
>
> On some TCP/IP stack implementations, or networks, the gains can be
> much smaller or none. I remember trying several times in a Mac OS X 32
> bits and not seeing much different, while on Linux I saw a very
> significant difference.
>
>  It seems that even the
>> [continuous] _changes feed will do *much* better with this setting,
>> notifying the listeners immediately without any buffering. True?
>>
>> One more Q: After changing this and if I invoke _restart, will the
>> settings take into effect?
>
> As soon as you change this setting via the REST API, subsequent
> requests should benefit from nodelay=true.
>
>>
>> Thanks,
>
> yw
>
>>
>> K.
>> ---
>> http://blitz.io
>> @pcapr
>>
>> On Tue, Aug 16, 2011 at 9:36 PM, Filipe David Manana
>> <fd...@apache.org> wrote:
>>> On Tue, Aug 16, 2011 at 9:18 PM, John Cheng
>>>>> Have you tried setting server's socket options, in the .ini config, as
>>>>> I suggested before? (setting nodelay to true)
>>>>>
>>>>>
>>>> You know I really thought I had tried that last night without seeing a
>>>> difference. I just tried it again right now and saw that was indeed the
>>>> source of my problem. Boy do I feel embarrassed right now.
>>>>
>>>> Thank you for your patience!
>>>
>>> Np.
>>> Yes, default is false. For me, on Linux 32 bits at least, nodelay set
>>> true makes a huge difference as well.
>>>
>>>
>>>>
>>>> Just for the record, this is the setting
>>>>
>>>> socket_options = [{recbuf, 262144}, {sndbuf, 262144}, {nodelay, true}]
>>>>
>>>> In default.ini it is commented out, and I assume by default nodelay is set
>>>> to false.
>>>>
>>>
>>>
>>>
>>> --
>>> Filipe David Manana,
>>> fdmanana@gmail.com, fdmanana@apache.org
>>>
>>> "Reasonable men adapt themselves to the world.
>>>  Unreasonable men adapt the world to themselves.
>>>  That's why all progress depends on unreasonable men."
>>>
>>
>
>
>
> --
> Filipe David Manana,
> fdmanana@gmail.com, fdmanana@apache.org
>
> "Reasonable men adapt themselves to the world.
>  Unreasonable men adapt the world to themselves.
>  That's why all progress depends on unreasonable men."
>

Re: CouchDB performance

Posted by Filipe David Manana <fd...@apache.org>.
On Tue, Aug 16, 2011 at 9:48 PM, kowsik <ko...@gmail.com> wrote:
> This is awesome. Didn't know about this setting. Is there a reason why
> we don't set nodelay to true by default?

On some TCP/IP stack implementations, or networks, the gains can be
much smaller or none. I remember trying several times in a Mac OS X 32
bits and not seeing much different, while on Linux I saw a very
significant difference.

 It seems that even the
> [continuous] _changes feed will do *much* better with this setting,
> notifying the listeners immediately without any buffering. True?
>
> One more Q: After changing this and if I invoke _restart, will the
> settings take into effect?

As soon as you change this setting via the REST API, subsequent
requests should benefit from nodelay=true.

>
> Thanks,

yw

>
> K.
> ---
> http://blitz.io
> @pcapr
>
> On Tue, Aug 16, 2011 at 9:36 PM, Filipe David Manana
> <fd...@apache.org> wrote:
>> On Tue, Aug 16, 2011 at 9:18 PM, John Cheng
>>>> Have you tried setting server's socket options, in the .ini config, as
>>>> I suggested before? (setting nodelay to true)
>>>>
>>>>
>>> You know I really thought I had tried that last night without seeing a
>>> difference. I just tried it again right now and saw that was indeed the
>>> source of my problem. Boy do I feel embarrassed right now.
>>>
>>> Thank you for your patience!
>>
>> Np.
>> Yes, default is false. For me, on Linux 32 bits at least, nodelay set
>> true makes a huge difference as well.
>>
>>
>>>
>>> Just for the record, this is the setting
>>>
>>> socket_options = [{recbuf, 262144}, {sndbuf, 262144}, {nodelay, true}]
>>>
>>> In default.ini it is commented out, and I assume by default nodelay is set
>>> to false.
>>>
>>
>>
>>
>> --
>> Filipe David Manana,
>> fdmanana@gmail.com, fdmanana@apache.org
>>
>> "Reasonable men adapt themselves to the world.
>>  Unreasonable men adapt the world to themselves.
>>  That's why all progress depends on unreasonable men."
>>
>



-- 
Filipe David Manana,
fdmanana@gmail.com, fdmanana@apache.org

"Reasonable men adapt themselves to the world.
 Unreasonable men adapt the world to themselves.
 That's why all progress depends on unreasonable men."

Re: CouchDB performance

Posted by kowsik <ko...@gmail.com>.
This is awesome. Didn't know about this setting. Is there a reason why
we don't set nodelay to true by default? It seems that even the
[continuous] _changes feed will do *much* better with this setting,
notifying the listeners immediately without any buffering. True?

One more Q: After changing this and if I invoke _restart, will the
settings take into effect?

Thanks,

K.
---
http://blitz.io
@pcapr

On Tue, Aug 16, 2011 at 9:36 PM, Filipe David Manana
<fd...@apache.org> wrote:
> On Tue, Aug 16, 2011 at 9:18 PM, John Cheng
>>> Have you tried setting server's socket options, in the .ini config, as
>>> I suggested before? (setting nodelay to true)
>>>
>>>
>> You know I really thought I had tried that last night without seeing a
>> difference. I just tried it again right now and saw that was indeed the
>> source of my problem. Boy do I feel embarrassed right now.
>>
>> Thank you for your patience!
>
> Np.
> Yes, default is false. For me, on Linux 32 bits at least, nodelay set
> true makes a huge difference as well.
>
>
>>
>> Just for the record, this is the setting
>>
>> socket_options = [{recbuf, 262144}, {sndbuf, 262144}, {nodelay, true}]
>>
>> In default.ini it is commented out, and I assume by default nodelay is set
>> to false.
>>
>
>
>
> --
> Filipe David Manana,
> fdmanana@gmail.com, fdmanana@apache.org
>
> "Reasonable men adapt themselves to the world.
>  Unreasonable men adapt the world to themselves.
>  That's why all progress depends on unreasonable men."
>

Re: CouchDB performance

Posted by Filipe David Manana <fd...@apache.org>.
On Tue, Aug 16, 2011 at 9:18 PM, John Cheng
>> Have you tried setting server's socket options, in the .ini config, as
>> I suggested before? (setting nodelay to true)
>>
>>
> You know I really thought I had tried that last night without seeing a
> difference. I just tried it again right now and saw that was indeed the
> source of my problem. Boy do I feel embarrassed right now.
>
> Thank you for your patience!

Np.
Yes, default is false. For me, on Linux 32 bits at least, nodelay set
true makes a huge difference as well.


>
> Just for the record, this is the setting
>
> socket_options = [{recbuf, 262144}, {sndbuf, 262144}, {nodelay, true}]
>
> In default.ini it is commented out, and I assume by default nodelay is set
> to false.
>



-- 
Filipe David Manana,
fdmanana@gmail.com, fdmanana@apache.org

"Reasonable men adapt themselves to the world.
 Unreasonable men adapt the world to themselves.
 That's why all progress depends on unreasonable men."

Re: CouchDB performance

Posted by John Cheng <jo...@gmail.com>.
On Tue, Aug 16, 2011 at 8:21 PM, Filipe David Manana <fd...@apache.org>wrote:

> On Tue, Aug 16, 2011 at 8:18 PM, John Cheng <jo...@gmail.com> wrote:
> > same kind of behavior that I've observed. It could help uncover some
> > unexpected performance regression in v 1.10.0.
>
> Have you tried setting server's socket options, in the .ini config, as
> I suggested before? (setting nodelay to true)
>
>
You know I really thought I had tried that last night without seeing a
difference. I just tried it again right now and saw that was indeed the
source of my problem. Boy do I feel embarrassed right now.

Thank you for your patience!

Just for the record, this is the setting

socket_options = [{recbuf, 262144}, {sndbuf, 262144}, {nodelay, true}]

In default.ini it is commented out, and I assume by default nodelay is set
to false.

Re: CouchDB performance

Posted by Filipe David Manana <fd...@apache.org>.
On Tue, Aug 16, 2011 at 8:18 PM, John Cheng <jo...@gmail.com> wrote:
> same kind of behavior that I've observed. It could help uncover some
> unexpected performance regression in v 1.10.0.

Have you tried setting server's socket options, in the .ini config, as
I suggested before? (setting nodelay to true)

>
>
>>
>> BTW, are you using the bulk-insert API or sending a separate HTTP request
>> for every document?
>>
>> —Jens
>>
>
> I am using a separate HTTP request for every document in every case:
>
> * python-couchdb API
> * Traditional HttpClient API ( ThreadSafeHttpClient with a large connection
> pool )
> * Async HttpClient
>
> I can probably get much better performance with the bulk-insert API, but I'm
> not trying to do a performance benchmark here (performance benchmarks are
> almost always pointless). I'm just documenting the different behaviors of
> CouchDB so I have better understanding of CouchDB.
>
> My python-couchdb code could use a bit of optimization, starting with using
> the 'batch=ok' parameter on inserts. However, that doesn't explain the
> drastic performance difference between testing against CouchDB 0.10.0 and
> 1.1.0. Something is wrong there and I'm not able to identify what it is.
>
> --
> ---
> John L Cheng
>



-- 
Filipe David Manana,
fdmanana@gmail.com, fdmanana@apache.org

"Reasonable men adapt themselves to the world.
 Unreasonable men adapt the world to themselves.
 That's why all progress depends on unreasonable men."

Re: CouchDB performance

Posted by John Cheng <jo...@gmail.com>.
On Tue, Aug 16, 2011 at 7:49 PM, Jens Alfke <je...@couchbase.com> wrote:

>
> On Aug 16, 2011, at 5:08 PM, John Cheng wrote:
>
> was the bottleneck? It also points out that client code for CouchDB
> access may not be easy to implement (I'm not familiar with the
> equivalent of java.nio API in Python, for example). It makes me
> hesitant to recommend using Python with CouchDB right now.
>
> Why? Asynchrony isn’t rocket science, and last I checked you could do
> asynchronous (or multithreaded) HTTP access in Python. (Isn’t the Twisted
> framework all about async networking?)
>

Twisted might have a good async networking library, but it is not something
I am familiar with. I can say that I've seen really good performance with an
async HttpClient when using Java, but I can't say the same about a framework
that I've never worked with before.

What' s imporatnt is that I'm curious to see if anyone else is seeing the
same kind of behavior that I've observed. It could help uncover some
unexpected performance regression in v 1.10.0.


>
> BTW, are you using the bulk-insert API or sending a separate HTTP request
> for every document?
>
> —Jens
>

I am using a separate HTTP request for every document in every case:

* python-couchdb API
* Traditional HttpClient API ( ThreadSafeHttpClient with a large connection
pool )
* Async HttpClient

I can probably get much better performance with the bulk-insert API, but I'm
not trying to do a performance benchmark here (performance benchmarks are
almost always pointless). I'm just documenting the different behaviors of
CouchDB so I have better understanding of CouchDB.

My python-couchdb code could use a bit of optimization, starting with using
the 'batch=ok' parameter on inserts. However, that doesn't explain the
drastic performance difference between testing against CouchDB 0.10.0 and
1.1.0. Something is wrong there and I'm not able to identify what it is.

-- 
---
John L Cheng

Re: CouchDB performance

Posted by Jens Alfke <je...@couchbase.com>.
On Aug 16, 2011, at 5:08 PM, John Cheng wrote:

was the bottleneck? It also points out that client code for CouchDB
access may not be easy to implement (I'm not familiar with the
equivalent of java.nio API in Python, for example). It makes me
hesitant to recommend using Python with CouchDB right now.

Why? Asynchrony isn’t rocket science, and last I checked you could do asynchronous (or multithreaded) HTTP access in Python. (Isn’t the Twisted framework all about async networking?)

BTW, are you using the bulk-insert API or sending a separate HTTP request for every document?

—Jens

Re: CouchDB performance

Posted by John Cheng <jo...@gmail.com>.
> Just to follow up on this. I've pushed a test case written in Scala to
> Github (https://github.com/jlcheng/couchdb-test). With this test case, I am
> using Apache HttpClient to perform testing. Since I am more familiar with
> Java, I was able to optimize the test case more. With Scala and CouchDB
> 0.10.0 (default install from Ubuntu 10.04 LTS), I am seeing 94 inserts per
> second, document size of 100k (using batch=ok). I think this pretty close to
> being optimized.
> However, going to a custom compiled CouchDB 1.1.0, I am seeing a mere 20
> inserts per second. I also see disk activity drop from ~7mb writes per
> second to ~2mb/sec. There must be something wrong with the way I have it
> compiled or configured. Any ideas where I should start?
>
By luck, I noticed that Apache provides an async HttpClient library.
By switching to the async library, where the code does not wait on
shared HTTP connections, I was able to get more reasonable performance
out of CouchDB 1.1.0. Now I am seeing 200 inserts/sec at 100 kb doc
size, and my CPU and disks are both heavily utilized.

This makes me wonder what changed between 0.10.0 and 1.1.0 that
requires such a change in how clients should access CouchDB. Why did
the traditional HttpClient code get only 20 inserts per second? Where
was the bottleneck? It also points out that client code for CouchDB
access may not be easy to implement (I'm not familiar with the
equivalent of java.nio API in Python, for example). It makes me
hesitant to recommend using Python with CouchDB right now.

Re: CouchDB performance

Posted by John Cheng <jo...@gmail.com>.
On Thu, Aug 11, 2011 at 12:29 PM, John Cheng <jo...@gmail.com> wrote:

> On Thu, Aug 11, 2011 at 11:36 AM, John Cheng <jo...@gmail.com>wrote:
>
>> On Thu, Aug 11, 2011 at 11:02 AM, Adam Kocoloski <ko...@apache.org>wrote:
>>
>>> Hi John, first thing I'd point out is that Filipe and Paul have done
>>> quite a lot of work on the JSON processor since 1.0.2 was released.  Trunk
>>> contains a JSON processor that calls out to YAJL instead of relying on pure
>>> Erlang code.  The improvement for large document bodies is pretty
>>> substantial.  Also, processing MBs of JSON is going to be CPU-bound in
>>> 1.0.2.  CouchDB makes good use of multicore servers to distribute some of
>>> the load if you throw concurrent requests at it.  Hope that helps,
>>>
>>> Adam
>>>
>>
>> It does help here. I'll see if I can get compile the latest version of
>> CouchDB on Ubuntu 10 LTS. It's been an adventure trying to compile CouchDB
>> so far!
>>
>
>
> Just compiled CouchDB 1.1.0
>
> Testing with doc target size = "100 kB", # of properties = "10", updates =
> "500", numDocs = "100"
> each document is approximately 100.1 kB
> Using increment handler function to perform update
> 500 updates in 42.1960351467 seconds, 11.8494545343 ops/second
>
> Now the updates dropped from 23 updates/sec to 11.84 updates/second
>
> Even inserts dropped to 24 inserts/second. Accroding to iostat, CPU was
> mostly idle (~85 to 92%) and I'm only getting 300 kB writes per second.
>
> I guess this could be a problem with httplib2. Is there any configuration
> or compile time options I may have missed that could cause such a big drop
> in performance?
>
> --
> ---
> John L Cheng
>

Just to follow up on this. I've pushed a test case written in Scala to
Github (https://github.com/jlcheng/couchdb-test). With this test case, I am
using Apache HttpClient to perform testing. Since I am more familiar with
Java, I was able to optimize the test case more. With Scala and CouchDB
0.10.0 (default install from Ubuntu 10.04 LTS), I am seeing 94 inserts per
second, document size of 100k (using batch=ok). I think this pretty close to
being optimized.

However, going to a custom compiled CouchDB 1.1.0, I am seeing a mere 20
inserts per second. I also see disk activity drop from ~7mb writes per
second to ~2mb/sec. There must be something wrong with the way I have it
compiled or configured. Any ideas where I should start?


-- 
---
John L Cheng

Re: CouchDB performance

Posted by Filipe David Manana <fd...@apache.org>.
You might want to try to set the TCP socket option nodelay to false.
It makes a huge difference for me on Linux:

https://github.com/apache/couchdb/blob/1.1.0/etc/couchdb/default.ini.tpl.in#L26

Also, as Adam said there's a JSON parser implemented in C, but only in
subversion's trunk, not yet in any official release.
In trunk, you also have snappy compression and other performance
improvements you might want to try out.
Some of these are in this blog post:

http://blog.couchbase.com/driving-performance-improvements-couchbase-single-server-20

On Thu, Aug 11, 2011 at 12:29 PM, John Cheng <jo...@gmail.com> wrote:
> On Thu, Aug 11, 2011 at 11:36 AM, John Cheng <jo...@gmail.com> wrote:
>
>> On Thu, Aug 11, 2011 at 11:02 AM, Adam Kocoloski <ko...@apache.org>wrote:
>>
>>> Hi John, first thing I'd point out is that Filipe and Paul have done quite
>>> a lot of work on the JSON processor since 1.0.2 was released.  Trunk
>>> contains a JSON processor that calls out to YAJL instead of relying on pure
>>> Erlang code.  The improvement for large document bodies is pretty
>>> substantial.  Also, processing MBs of JSON is going to be CPU-bound in
>>> 1.0.2.  CouchDB makes good use of multicore servers to distribute some of
>>> the load if you throw concurrent requests at it.  Hope that helps,
>>>
>>> Adam
>>>
>>
>> It does help here. I'll see if I can get compile the latest version of
>> CouchDB on Ubuntu 10 LTS. It's been an adventure trying to compile CouchDB
>> so far!
>>
>
>
> Just compiled CouchDB 1.1.0
>
> Testing with doc target size = "100 kB", # of properties = "10", updates =
> "500", numDocs = "100"
> each document is approximately 100.1 kB
> Using increment handler function to perform update
> 500 updates in 42.1960351467 seconds, 11.8494545343 ops/second
>
> Now the updates dropped from 23 updates/sec to 11.84 updates/second
>
> Even inserts dropped to 24 inserts/second. Accroding to iostat, CPU was
> mostly idle (~85 to 92%) and I'm only getting 300 kB writes per second.
>
> I guess this could be a problem with httplib2. Is there any configuration or
> compile time options I may have missed that could cause such a big drop in
> performance?
>
> --
> ---
> John L Cheng
>



-- 
Filipe David Manana,
fdmanana@gmail.com, fdmanana@apache.org

"Reasonable men adapt themselves to the world.
 Unreasonable men adapt the world to themselves.
 That's why all progress depends on unreasonable men."

Re: CouchDB performance

Posted by John Cheng <jo...@gmail.com>.
On Thu, Aug 11, 2011 at 11:36 AM, John Cheng <jo...@gmail.com> wrote:

> On Thu, Aug 11, 2011 at 11:02 AM, Adam Kocoloski <ko...@apache.org>wrote:
>
>> Hi John, first thing I'd point out is that Filipe and Paul have done quite
>> a lot of work on the JSON processor since 1.0.2 was released.  Trunk
>> contains a JSON processor that calls out to YAJL instead of relying on pure
>> Erlang code.  The improvement for large document bodies is pretty
>> substantial.  Also, processing MBs of JSON is going to be CPU-bound in
>> 1.0.2.  CouchDB makes good use of multicore servers to distribute some of
>> the load if you throw concurrent requests at it.  Hope that helps,
>>
>> Adam
>>
>
> It does help here. I'll see if I can get compile the latest version of
> CouchDB on Ubuntu 10 LTS. It's been an adventure trying to compile CouchDB
> so far!
>


Just compiled CouchDB 1.1.0

Testing with doc target size = "100 kB", # of properties = "10", updates =
"500", numDocs = "100"
each document is approximately 100.1 kB
Using increment handler function to perform update
500 updates in 42.1960351467 seconds, 11.8494545343 ops/second

Now the updates dropped from 23 updates/sec to 11.84 updates/second

Even inserts dropped to 24 inserts/second. Accroding to iostat, CPU was
mostly idle (~85 to 92%) and I'm only getting 300 kB writes per second.

I guess this could be a problem with httplib2. Is there any configuration or
compile time options I may have missed that could cause such a big drop in
performance?

-- 
---
John L Cheng

Re: CouchDB performance

Posted by John Cheng <jo...@gmail.com>.
On Thu, Aug 11, 2011 at 11:02 AM, Adam Kocoloski <ko...@apache.org>wrote:

> Hi John, first thing I'd point out is that Filipe and Paul have done quite
> a lot of work on the JSON processor since 1.0.2 was released.  Trunk
> contains a JSON processor that calls out to YAJL instead of relying on pure
> Erlang code.  The improvement for large document bodies is pretty
> substantial.  Also, processing MBs of JSON is going to be CPU-bound in
> 1.0.2.  CouchDB makes good use of multicore servers to distribute some of
> the load if you throw concurrent requests at it.  Hope that helps,
>
> Adam
>

It does help here. I'll see if I can get compile the latest version of
CouchDB on Ubuntu 10 LTS. It's been an adventure trying to compile CouchDB
so far!

Re: CouchDB performance

Posted by Adam Kocoloski <ko...@apache.org>.
Hi John, first thing I'd point out is that Filipe and Paul have done quite a lot of work on the JSON processor since 1.0.2 was released.  Trunk contains a JSON processor that calls out to YAJL instead of relying on pure Erlang code.  The improvement for large document bodies is pretty substantial.  Also, processing MBs of JSON is going to be CPU-bound in 1.0.2.  CouchDB makes good use of multicore servers to distribute some of the load if you throw concurrent requests at it.  Hope that helps,

Adam

On Aug 11, 2011, at 1:54 PM, John Cheng wrote:

> I published some Python scripts to help me evaluate the performance of
> CouchDB (https://github.com/jlcheng/couchdb-test). I was hoping the folks
> here can help me understand what I am seeing.
> 
> The raw spreadsheet of my findings:
> https://spreadsheets0.google.com/spreadsheet/pub?hl=en_US&hl=en_US&key=0AtagEcs-wlFDdGVfMGItdUIxQXcyTmZxdVdOMUw4TWc&output=html
> 
> First, I've found that the Document Update Handler API performed worse than
> using Python to get, modify, then update the document when the application
> code is running on the same machine as CouchDB. This is surprising to me. It
> leads me to believe that when the network is not a bottleneck, it might be
> better to avoid update handers.
> 
> Second, the insert performance is not as good as I'd hoped - at least for
> large documents (100 kB+). The update performance is even worse. When using
> the "benchbulk.sh" script with a DOCSIZE of 100 kB and a BULKSIZE of 15, I
> am seeing about 12 inserts per second. Using my Python script, I was seeing
> 81 inserts/second and 30 updates/seconds for 100 kB documents. This is on a
> single 7200 rpm SATA drive. A write performance of 3 MB per second seems
> low.
> 
> In brief, there are two things I can learn more about: Is is expected for
> the Document Update API to be slower? Two, does this kind of write and
> update performance look right?
> 
> This is a Ubunut 10.01 system with
> 
> 4GB RAM
> 900GB 7200 rpm SATA drive
> CouchDB 1.0.2 compiled using https://github.com/couchone/build-couchdb
> 
> And the stock CouchDB 0.10.0 from Ubuntu has similar performance as well.


Re: CouchDB performance

Posted by John Cheng <jo...@gmail.com>.
On Thu, Aug 11, 2011 at 11:02 AM, Alexander Shorin <kx...@gmail.com> wrote:

> Hi, John!
>
> Regarding couchdb-python there is opened issue about insert performance:
> http://code.google.com/p/couchdb-python/issues/detail?id=193
> Suddenly, nothing serious could be done there, but you may take a look
> at PyCurl solution and solution using raw sockets instead of httplib
> module.
>
>
Thanks, I'll explore doing some performance evaluation using Java. Although
I'd have to say it'll be hard to prototype something in a couple of days
like I could with Python.

Re: CouchDB performance

Posted by Alexander Shorin <kx...@gmail.com>.
Hi, John!

Regarding couchdb-python there is opened issue about insert performance:
http://code.google.com/p/couchdb-python/issues/detail?id=193
Suddenly, nothing serious could be done there, but you may take a look
at PyCurl solution and solution using raw sockets instead of httplib
module.

------------------
,,,^..^,,,



On Thu, Aug 11, 2011 at 9:54 PM, John Cheng <jo...@gmail.com> wrote:
> I published some Python scripts to help me evaluate the performance of
> CouchDB (https://github.com/jlcheng/couchdb-test). I was hoping the folks
> here can help me understand what I am seeing.
>
> The raw spreadsheet of my findings:
> https://spreadsheets0.google.com/spreadsheet/pub?hl=en_US&hl=en_US&key=0AtagEcs-wlFDdGVfMGItdUIxQXcyTmZxdVdOMUw4TWc&output=html
>
> First, I've found that the Document Update Handler API performed worse than
> using Python to get, modify, then update the document when the application
> code is running on the same machine as CouchDB. This is surprising to me. It
> leads me to believe that when the network is not a bottleneck, it might be
> better to avoid update handers.
>
> Second, the insert performance is not as good as I'd hoped - at least for
> large documents (100 kB+). The update performance is even worse. When using
> the "benchbulk.sh" script with a DOCSIZE of 100 kB and a BULKSIZE of 15, I
> am seeing about 12 inserts per second. Using my Python script, I was seeing
> 81 inserts/second and 30 updates/seconds for 100 kB documents. This is on a
> single 7200 rpm SATA drive. A write performance of 3 MB per second seems
> low.
>
> In brief, there are two things I can learn more about: Is is expected for
> the Document Update API to be slower? Two, does this kind of write and
> update performance look right?
>
> This is a Ubunut 10.01 system with
>
> 4GB RAM
> 900GB 7200 rpm SATA drive
> CouchDB 1.0.2 compiled using https://github.com/couchone/build-couchdb
>
> And the stock CouchDB 0.10.0 from Ubuntu has similar performance as well.
>

Re: CouchDB performance

Posted by Jason Smith <jh...@iriscouch.com>.
On Fri, Aug 12, 2011 at 12:54 AM, John Cheng <jo...@gmail.com> wrote:
> This is a Ubunut 10.01 system with
>
> 4GB RAM
> 900GB 7200 rpm SATA drive
> CouchDB 1.0.2 compiled using https://github.com/couchone/build-couchdb

Awesome! Note that Build CouchDB development continues at an
alternative GitHub repository:

https://github.com/iriscouch/build-couchdb

It always builds the latest stable release; although I see that you've
done that already, so this note is just for posterity.

-- 
Iris Couch