On 06/17/2008 12:11 PM, Brad Schick wrote:
> I am seeing very poor write performance running CouchDB on Ubuntu Linux
> 8.04. I built CouchDB from source about a week ago, and I am using the
> Python wrapper to access it all on localhost.
>
> I am trying to add over 90,000 documents (each is about 400 bytes) and
> finding that I can only add about 16 documents per second. And while
> this is happening, my CPU is about 75% idle.
>
I'm running these tests on an old machine running a Gnome desktop, so it
is not a clean environment, but it seems like the bottleneck should
still be apparent. So far disk access looks like the most likely issue.
Running a single writer client, I get the following results from 'iostat
-x sdb -k 1'
avg-cpu: %user %nice %system %iowait %steal %idle
21.00 0.00 7.00 1.00 0.00 71.00
Device: rrqm/s wrqm/s r/s w/s rkB/s wkB/s
avgrq-sz avgqu-sz await svctm %util
sdb 0.00 0.00 0.00 78.00 0.00 326.50
8.37 0.77 10.00 9.54 74.40
Although it doesn't look totally saturated, I found a fairly similar
maximum %util running 'stress -d 1 --hdd-bytes 400' (many small disk
writes).
Here is the output of 'vmstat 1' with one writer client running
procs -----------memory---------- ---swap-- -----io---- -system--
----cpu----
r b swpd free buff cache si so bi bo in cs us sy
id wa
1 0 39224 589712 40 156556 0 0 0 321 502 873 23 9
67 1
0 0 39224 589656 40 156624 0 0 0 321 388 630 24 6
69 1
0 0 39224 589492 40 156680 0 0 0 279 460 804 23 6
70 1
0 0 39224 589476 40 156740 0 0 0 277 370 575 20 8
71 1
The only real differences between that and "idle" (shown below) are the
blocks-out a small amount of iowait.
procs -----------memory---------- ---swap-- -----io---- -system--
----cpu----
r b swpd free buff cache si so bi bo in cs us sy
id wa
0 0 39224 581296 40 167920 0 0 0 10 305 570 3 3
94 0
0 0 39224 581296 40 167920 0 0 0 0 194 306 3 1
96 0
0 0 39224 581296 40 167920 0 0 0 0 283 528 3 2
95 0
0 0 39224 581296 40 167920 0 0 0 0 193 297 3 0
97 0
I'm not sure what else to check from the OS. I found erlang's fprof
(http://www.erlang.org/doc/man/fprof.html), but I haven't tried to
figure how to start couchdb in that environment. I'll test block updates
next.
-Brad