Project

General

Profile

[Solved] proxy a stream without buffering by lighttpd

Added by smikesmith almost 8 years ago

I'm using a small AMR system, SAM9x25, 400MHz, linux 2.6.39, lighttpd 1.4.43, 128MB RAM, 'server-upload-dirs'="/tmp", which is a 61MB ram disk. We need to send an octet-stream up to 2GB from client, proxy by lighttpd on port 80, to nodejs server on localhost port 8080.

1. Lighttpd chunks the input from client into /tmp, exhausting memory.
2. nodejs receives octet stream as literal stream and saves portions to sd card (~3MB/s).
3. a short json message is returned upon completion.

  • Is there a way to have Lighttpd pass the proxy stream directly through with little or no buffering to /tmp?

client header is essentially Content-Type=octet-stream+auth-basic+Content-Length=<filesize>

Config files attached

cgi.conf (386 Bytes) cgi.conf config for mod_cgi
common.conf (2.61 KB) common.conf the general configuration (directed from lighttpd.conf)
fastcgi.conf (1.09 KB) fastcgi.conf config for mod_fastcgi
modules.conf (287 Bytes) modules.conf modules used
proxy.conf (257 Bytes) proxy.conf mod_proxy

Replies (2)

RE: proxy a stream without buffering by lighttpd - Added by smikesmith almost 8 years ago

Answered my own question:

add line "server.stream-request-body = 2" to our "common.conf" configuration (or somewhere within the config units).

    (1-2/2)