Hi
We are trying to put an nginx (or haproxy) in front of a CouchDB server to
see if we can load balance some of our databases between multiple machines.
We are currently on 1.6.1 and cannot move upto 2.x to take advantage of the
newer features.

The problem is that the _changes urls are working pretty nice(through nginx
or haproxy) as long as the query string length is < 8192 bytes. We do have
some filtered replications that take the UUIDs as query parameters, and if
they are exceeding 8192 bytes, then we get a "no reply from server" in the
case of HAProxy and a "Connection reset by peer" in the case of Nginx
fronting CouchDB.

The format of the query is something like :

curl -vvvv -XGET
'http://username:password@url:5984/<database>/_changes?feed=normal&heartbeat=300000&style=all_docs&filter=filtername&docIds=<list
of ids>

Sometimes, we do have a lot of ids in that it exceeds the limit of 8192 and
when we try to limit it, it returns the values properly, but if we go
beyond the 8192 limit, it seems to be truncated and gives an error.

Please note that none of these happen if we go directly to CouchDB. This is
only a problem if we go through Nginx or HAProxy. The nginx config is as
mentioned here (
https://cwiki.apache.org/confluence/display/COUCHDB/Nginx+as+a+proxy) and
HAProxy is quite straightforward where all requests to the frontend are
sent to a couchdb server.

Also, we cannot use POST for the _changes as there is a issue with
filterParameters expected to be in the URL even if its POST (
https://github.com/couchbase/couchbase-lite-ios/issues/1139).

Any suggestions/workaround to solve this will be greatly helpful.

Thanks
Raja

 --
Raja
rajasaur at gmail.com

Reply via email to