lighty's life

lighty developer blog

Faster FastCGI

While I was throwing away from bogus data-copy operations from the mod-proxy-core code I stumbled over a simple question:

Why do we copy the HTTP response data from the backends at all ?

We are just forwarding them in most cases without touching them.

How about:

HTTP/1.1 200 OK
Content-Type: text/html
X-LIGHTTPD-send-tempfile: /dev/shm/fcgi-output/j37f467d

… and lighty removing the file when it has sent it.

/dev/shm is memory and the application is writing to it and only passes a reference to the webserver where it can take the content from.

Especially for large content which is generated on the fly this might help alot.

Crazy or Cool

Now it takes someone to implement and benchmark it. Adding it as easy: just add the header filter to mod_fastcgi and set is_temp on the file-chunk.