Re: Buffering of huge POSTs to CGI and alternatives

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 15/11/10 19:00, Jeff Trawick wrote:
> On Mon, Nov 15, 2010 at 4:43 AM, Steven Simpson <ss@xxxxxxxxxxxxxxxx> wrote:
>> Can [CGI/Apache] deal
>> with huge message bodies, such as those exceeding virtual RAM, by saving
>> to disc (for example)?
> mod_cgi/mod_cgid: request will fail with 411 if client doesn't send
> content-length;

So it's extremely likely that all clients, certainly major browsers,
will have to send Content-Length, or there'd be failures all the time.

I've just realised I've muddled up responses (whose lengths can be
implied by connection close) and requests (whose lengths can't).  (I
knew this, just forgot!)  Chunking is still a possibility, but since it
is a 1.1 feature, and in isolation a client doesn't know that the server
is 1.1, it is practically likely to always send Content-Length and not
risk chunking.

What's confused me is that we did a quick test a few days ago with
Safari and Firefox on a dummy CGI script.  Using one of the Firefox
extensions, we could see that it indeed sent Content-Length.  In
contrast, Safari's developer tools claimed that no length or chunking
was sent.  I'll have to try them again, as maybe those tools fib a bit.

>  i.e., they don't have the logic to spool the body and
> compute CONTENT_LENGTH

So, apart from small amounts of buffering in Apache and the network
stack, the body will mostly be waiting in the client if it's
particularly big, until the CGI program starts consuming it...?

[snip good summary of alternatives' behaviours]

> So: mod_fcgid seems closest to what you need, and whether it works for
> you today is dependent on whether or not you need CONTENT_LENGTH set
> due to a chunked request body.

Thanks for that!

I'll do some deeper tests of the POSTing behaviour of clients, and
hopefully find that CGI won't be a problem.  If it is, I'll investigate
mod_fcgid.

Thanks to all respondents!

Cheers,

Steven

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux