Project

General

Profile

[Solved] streaming http post chuck from lighttpd to python WSGI app via FastCGI

Added by temp.sha almost 7 years ago

Hi,

My lighttpd server communicates with the Python WSGI application via FastCGI.
I observed when I try to uploaded a file of 200Mb from my web browser using
HTTP POST method, lighttpd server saves the uploaded file in to several smaller chucks.
When whole POST data is received by the lighhttpd, it then sends those chunks
to Python WSGI application.
I want that as soon as lighttpd server gets the POST data from browsers it should stream
it to Python WSGI app using some streaming mechanism between lighttpd and Python WSGI.
As I do not have enough space in my embedded device running lighttpd server and
Python WSGI app.

Can any one help me to know how can this be done?

Web browser <---------------> lighttpd <-----------via Fast CGI-----------> Python WSGI App

some info:
lighttpd version - 1.4.29
running lighttpd and Python WSGI in my own embedded device having customized linux kernel.

Thanks...


Replies (2)

RE: [Solved] streaming http post chuck from lighttpd to python WSGI app via FastCGI - Added by gstrauss almost 7 years ago

lighttpd version - 1.4.29

That is laughably old, as in almost 6 years old.

Since lighttpd 1.4.40, lighttpd supports streaming request and response body, if configured (which is not the default)
server.stream-request-body
server.stream-response-body

RE: [Solved] streaming http post chuck from lighttpd to python WSGI app via FastCGI - Added by temp.sha almost 7 years ago

I could not understand the difference between the two.

server.stream-request-body = 1 stream request body to backend; buffer to temp files
server.stream-request-body = 2 stream request body to backend; minimal buffering might block upload

In my test project, in both the cases I am seeing that directory pointed by "server.upload-dirs" is empty and backend gets the data
as soon as HTTP POST uploads.
what is the difference here?

    (1-2/2)