Skip to content

scripts/lighttpd: modify lighttpd resource configuration

Karel Koci requested to merge lighttpd-oom into master

The lighttpd in defaults does not use streaming. Every request is first collected to temporally directory and only when it is complete is processed. The default directory used for this (the upload-dirs option) is /var/tmp which is in RAM in our case (and that is for sure what we want to not damage flash storage). The issue is that for big requests such as upload or download of big files that are way bigger than our RAM this triggers OOM.

This in default configures Lighttpd to always use streaming (this should probably be system default on OpenWrt but let's enforce it here as well till that is the case) thus not using '/var/tmp' at all. Once the storage plugin is configured the configuration changes and we use directory '/srv/.lighttpd-tmp' to buffer requests.

The login here is based on the one for syslog-ng configuration.

Reference: https://redmine.lighttpd.net/projects/lighttpd/wiki/Docs_ResourceTuning

Continuation of: turris/os/packages#665 (closed)

Fixes: turris/os/packages!802 (closed)

On notice to @gstrauss

Edited by Martin Matějek

Merge request reports