zstd patch
This commit is contained in:
@@ -250,6 +250,21 @@ function clean_install() {
|
||||
if [ ! -d /opt/mod/zstd-nginx-module-${NGX_MOD_ZSTD} ]; then
|
||||
cd /opt/mod/; wget https://github.com/tokers/zstd-nginx-module/archive/refs/tags/${NGX_MOD_ZSTD}.tar.gz
|
||||
cd /opt/mod/; tar xf ${NGX_MOD_ZSTD}.tar.gz; rm -Rf ${NGX_MOD_ZSTD}.tar.gz
|
||||
|
||||
# Local fix for the zstd-nginx-module 0.1.1 worker CPU spin (100% CPU on
|
||||
# a flushed compressible response: proxy_buffering off, SSE, PHP flush()).
|
||||
# Upstream is unmaintained (0.1.1 is the latest tag), so we carry it.
|
||||
# Applied here rather than in apply_patches() because the module lives
|
||||
# outside the nginx source tree; the [ ! -d ] guard above makes this a
|
||||
# fresh-extract-only operation (rm the module dir to force a re-patch).
|
||||
zstd_fix="${SCRIPT_DIR}/patches/zstd-nginx-module-${NGX_MOD_ZSTD}-flush-cpu-spin.patch"
|
||||
if [ "${APPLY_PATCH_ZSTD_FLUSH_FIX:-1}" = "1" ]; then
|
||||
[ -f "$zstd_fix" ] || { echo "[patch] MISSING $zstd_fix"; exit 1; }
|
||||
echo "[patch] applying zstd-nginx-module-${NGX_MOD_ZSTD}-flush-cpu-spin.patch"
|
||||
( cd /opt/mod/zstd-nginx-module-${NGX_MOD_ZSTD} && patch -p1 < "$zstd_fix" )
|
||||
else
|
||||
echo "[patch] skip zstd flush fix (APPLY_PATCH_ZSTD_FLUSH_FIX=0)"
|
||||
fi
|
||||
fi
|
||||
|
||||
# END OF NGINX MODULES
|
||||
|
||||
Reference in New Issue
Block a user