couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Filipe David Manana <>
Subject worst performance in 1.1.x (compared to 1.0.x)
Date Sun, 12 Dec 2010 12:17:24 GMT

While running a relaximation test to compare read/write performance
between 1.1.x and 1.0.x, I found out that 1.1.x has worst performance

It seems the cause is related to the new Mochiweb version introduced
in commit 4b0948ddb3a428f8a5330e05745b2fbd4ccf9375 -

Comparing the performance of this revision with the previous one
(cd214b23e8129868d4a7020ddafd55a16e496652), I get the following

Both read and write performance are worse for

The cause could be the configuration we pass to Mochiweb in
couch_httpd. The new Mochiweb sets the nodelay option to false by
default and it uses now several acceptor processes (16 by default).
However even with the following small patch I still get about the same
disappointing results:

diff --git a/src/couchdb/couch_httpd.erl b/src/couchdb/couch_httpd.erl
index 23ff7f9..e93c7e7 100644
--- a/src/couchdb/couch_httpd.erl
+++ b/src/couchdb/couch_httpd.erl
@@ -97,7 +97,9 @@ start_link(Name, Options) ->
     {ok, Pid} = case mochiweb_http:start(Options ++ [
         {loop, Loop},
         {name, Name},
-        {ip, BindAddress}
+        {ip, BindAddress},
+        {nodelay, true},
+        {acceptor_pool_size, 32}
     ]) of
     {ok, MochiPid} -> {ok, MochiPid};
     {error, Reason} ->

(Also tried higher values for acceptor_pool_size, which doesn't help)

The test was run like this:

$ node tests/compare_write_and_read.js --wclients 100 --rclients 200 \
  -name1 new_4b0948ddb3a428f8a5330e05745b2fbd4ccf9375 -name2
old_cd214b23e8129868d4a7020ddafd55a16e496652 \
  -url1 http://localhost:5984/ -url2 http://localhost:5985/ \
  --duration 120

With the following document template (file

Can anyone confirm these results?
If confirmed, I would say this is a blocker for 1.1.0.


Filipe David Manana,,

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

View raw message