Project

General

Profile

Bug #376

Reimplement upload (POST) handling to match apache/zeus/thttpd/boa functionality

Added by Anonymous over 11 years ago. Updated 11 months ago.

Status:
Fixed
Priority:
Normal
Assignee:
-
Category:
core
Target version:
Start date:
Due date:
% Done:

100%

Missing in 1.5.x:

Description

Uploads (POST/PUT data) should be handled without the server performing any buffering, so that cgi/fastcgi/scgi applications can determine their own buffering method. This will also improve lighttpd's CGI compatibility with every widely used http server implementation.

-- cody

Associated revisions

Revision 695c8f4e (diff)
Added by gstrauss 11 months ago

[config] config options to stream request/response (#949, #376)

This allows admin to configure if response is collected in entirety
prior to sending data to client

For compatibility with existing configs, default is existing behavior:
buffer entire response prior to sending data to client

The following are config options, though not all implemented yet

// default: buffer entire request body before connecting to backend
server.stream-request-body = 0

// stream request body to backend; buffer to temp files
server.stream-request-body = 1

// stream request body to backend; minimal buffering might block upload
server.stream-request-body = 2

// default: buffer entire response body before sending to client
server.stream-request-body = 0

// stream response body to client; buffer to temp files
server.stream-request-body = 1

// stream response body to client; minimal buffering might block backend
server.stream-request-body = 2

x-ref:
"fastcgi, cgi, flush, php5 problem."
https://redmine.lighttpd.net/issues/949
"Reimplement upload (POST) handling to match apache/zeus/thttpd/boa functionality"
https://redmine.lighttpd.net/issues/376

Revision f69f209e (diff)
Added by gstrauss 11 months ago

[core] option to stream request body to backend (fixes #376)

Set server.stream-request-body = 1 or server.stream-request-body = 2
to have lighttpd connect to backend (CGI, FastCGI, SCGI, proxy)
immediately after parsing request headers, and to stream request body
as it arrives.

default: buffer entire request body before connecting to backend,
in order to avoid tying up (limited) backend resources which are often
implemented using libraries which wait for entire request body before
proceeding.

x-ref:
"Reimplement upload (POST) handling to match apache/zeus/thttpd/boa functionality"
https://redmine.lighttpd.net/issues/376

History

#1 Updated by Anonymous over 11 years ago

to buffer or not to buffer, this is a problem. what if u have 5 fastcgi worker at most but having 5 user uploading at the same time slowly? all other fastcgi request is blocked. (with php, u have static number of workers)

anyways, it's in jan's TODO to support both mode, tune by conf.

-- xuefer

#2 Updated by gstrauss 12 months ago

  • Description updated (diff)
  • Status changed from New to Patch Pending
  • Assignee deleted (jan)
  • Target version set to 1.4.40

New: asynchronous, bidirectional streaming support for request and response
Submitted pull request: https://github.com/lighttpd/lighttpd1.4/pull/66

#3 Updated by gstrauss 11 months ago

  • Status changed from Patch Pending to Fixed
  • % Done changed from 0 to 100

Also available in: Atom