Hi Raja,

This sounds like this issue:
https://issues.apache.org/jira/browse/COUCHDB-3293

It stems from a bug in http parser
http://erlang.org/pipermail/erlang-questions/2011-June/059567.html and
perhaps mochiweb not knowing how to handle a "message too large error".

One way to work around it is to increase the recbuf, say something like
this (in 2.0):

[chttpd]
server_options = [{recbuf, 65536}]

In 1.6 the corresponding option I think is in httpd section:

[httpd]
socket_options = ...

See if that helps at all.

And btw, that was the reason for introducing these two configuration
parameters:

couchdb.max_document_id_length = infinity | Integer

replicator.max_document_id_length = infinity | Integer

Basically allowing another way to "avoid" the bug by limiting the size of
document ids accepted in the system.

Also it seems the behavior in mochiweb was fixed as well to send 413 as
opposed to timing out or closing teh connection as before. But the problem
with the Erlang http parser might still be there:

https://github.com/mochi/mochiweb/commit/a6fdb9a3af1301c8be68cd1f85a87ce3028da07a

Cheers,
-Nick


On Wed, Feb 7, 2018 at 1:40 PM, Raja <rajas...@gmail.com> wrote:

> 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