couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Patrick Antivackis" <patrick.antivac...@gmail.com>
Subject Re: streaming attachments writes
Date Fri, 16 Jan 2009 21:54:49 GMT
Damien,
For what i saw in previous tests, if you not use the chunk method, then you
get an error caught by mochiweb (so no error in couchdb).
It occurs in mochiweb_request line 138 with the gen_tcp:recv  call :

recv(Length, Timeout) ->
    case gen_tcp:recv(Socket, Length, Timeout) of
        {ok, Data} ->
            put(?SAVE_RECV, true),
            Data;
        _ ->
            exit(normal)
    end.


The answer catched by the case  _  is in fact  {error, enomem}

There is no error in couchdb as the exit is "normal" !!!

For what i read (see answers from
http://www.google.fr/search?q=16M+gen_tcp%3Arecv), if Length is too big
(some says 16M, for me it's 64M) gen_tcp:recv sends back an enomem error.



2009/1/16 Damien Katz <damien@apache.org>

>
> On Jan 16, 2009, at 8:37 AM, Benoit Chesneau wrote:
>
>  On Fri, Jan 16, 2009 at 1:55 PM, Damien Katz <damien@apache.org> wrote:
>>
>>> Chunked isn't allowed right now. Why are you sending a file chunked?
>>>
>>> -Damien
>>>
>>
>> Chunked seem the only method to send a big files in with curl in
>> command line, since it force it to split its read. I don't really need
>> chunked encoding for now.
>>
>
> Chunked is only necessary when you don't know the length ahead of time,
> streaming a file of known length up to a web server shouldn't require any
> buffering by the http client. Just don't send it chunked and it should work
> and use very little memory.
>
> -Damien
>
>
>
>>
>> This script allowed me to send a 4Go files to couch without using too
>> much memory :
>> http://friendpaste.com/28kxlg0FrjbOSTyDLFLbZb
>>
>> - benoƮt
>>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message