You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Ingo Radatz <th...@googlemail.com> on 2014/10/14 15:04:16 UTC
CouchDB server responses 204 for request that trigger indexing
I use a CouchDB 1.6.0 behind a HAproxy. The CouchDB gets bigger amounts of docs as bulk uploads.
After an upload the next request triggers indexing as expected. Now my problem:
When the indexing takes too long the CouchDB seems to request a 204 (seen in the haproxy.log) to the transparent HAproxy (which itself translates that to a 502 Bad Gateway).
I there an timeout setting for the mochiweb server which can be increased?
Re: CouchDB server responses 204 for request that trigger indexing
Posted by Ingo Radatz <th...@googlemail.com>.
Thx jan, that helps to sort out CouchDB as source of the problem. I had that suspicion before but the HAproxy logs saying CouchDB has responded with 204 - perhaps that is a "trick" of HAproxy. Something like "What should we log when we run into a timeout? Hmm, no content!"
Re: CouchDB server responses 204 for request that trigger indexing
Posted by Jan Lehnardt <ja...@apache.org>.
On 14 Oct 2014, at 15:04 , Ingo Radatz <th...@googlemail.com> wrote:
> I use a CouchDB 1.6.0 behind a HAproxy. The CouchDB gets bigger amounts of docs as bulk uploads.
>
> After an upload the next request triggers indexing as expected. Now my problem:
>
> When the indexing takes too long the CouchDB seems to request a 204 (seen in the haproxy.log) to the transparent HAproxy (which itself translates that to a 502 Bad Gateway).
>
> I there an timeout setting for the mochiweb server which can be increased?
It seems that the timeout is on HAproxy’s side. CouchDB won’t respond with a 204 for view requests, neither does Mochiweb on its own. The only place a 204 is even mentioned in the CouchDB source is when doing CORS preflight requests.
Best
Jan
--
Re: CouchDB server responses 204 for request that trigger indexing
Posted by Whorn <th...@googlemail.com>.
Thx Johannes, that works around it technically but in my case the requester wants to wait as long as the indexing takes.
We have the httpd/server_options configuration mentioned in the docs
http://couchdb.readthedocs.org/en/1.6.1/config/http.html#httpd/server_options
but i struggle to find/understand the docs about it.
Am i right to look at:
http://erldocs.com/R14Aextra/mochiweb/mochiweb_response.html
greetings, ingo
> Am 14.10.2014 um 15:34 schrieb Johannes Jörg Schmidt <sc...@netzmerk.com>:
>
> Hi Ingo,
>
> You know you can always query the view with ?stale=update_after to get the
> current (outdated) view and trigger the indexing after the view has been
> returned to the client.
>
> http://docs.couchdb.org/en/latest/api/ddoc/views.html?highlight=update_after
>
> Greetings
> Johannes
>
> 2014-10-14 15:04 GMT+02:00 Ingo Radatz <th...@googlemail.com>:
>
>> I use a CouchDB 1.6.0 behind a HAproxy. The CouchDB gets bigger amounts of
>> docs as bulk uploads.
>>
>> After an upload the next request triggers indexing as expected. Now my
>> problem:
>>
>> When the indexing takes too long the CouchDB seems to request a 204 (seen
>> in the haproxy.log) to the transparent HAproxy (which itself translates
>> that to a 502 Bad Gateway).
>>
>> I there an timeout setting for the mochiweb server which can be increased?
Re: CouchDB server responses 204 for request that trigger indexing
Posted by Johannes Jörg Schmidt <sc...@netzmerk.com>.
Hi Ingo,
You know you can always query the view with ?stale=update_after to get the
current (outdated) view and trigger the indexing after the view has been
returned to the client.
http://docs.couchdb.org/en/latest/api/ddoc/views.html?highlight=update_after
Greetings
Johannes
2014-10-14 15:04 GMT+02:00 Ingo Radatz <th...@googlemail.com>:
> I use a CouchDB 1.6.0 behind a HAproxy. The CouchDB gets bigger amounts of
> docs as bulk uploads.
>
> After an upload the next request triggers indexing as expected. Now my
> problem:
>
> When the indexing takes too long the CouchDB seems to request a 204 (seen
> in the haproxy.log) to the transparent HAproxy (which itself translates
> that to a 502 Bad Gateway).
>
> I there an timeout setting for the mochiweb server which can be increased?