This script is intended to ease building optimized LEMP stack and more using the newest software and libraries.
The script mostly consists of me experimenting with more advanced scripting concepts, please be kind :)
Architecture/CPU specific optimizations are tuned for Raspberry Pi 4B
The script is written in zsh
git clone https://github.com/lopatar/LEMP-Optimizations.git
cd LEMP-Optimizations
chmod +x install.sh
./install.shAll configuration options are located in config.sh
- NGINX
- Removing unnecessary modules and focusing strictly on the HTTP part
- Enabling thread pools
- Enabling file-aio
- Prioritizing HTTP3/QUIC
- Brotli compression
- Supporting PCRE2 versions higher than officially supported
- Including hardened TLS configuration
- MariaDB
- Newer release than default package
- Architecture specific optimizations
- Optimized server configuration
- PHP-FPM (Installed from deb.sury.org)
- OpenSSL/BoringSSL (BoringSSL is not currently supported)
- Jemalloc (optimized memory allocator preventing heap fragmentation typically observed on long-running software)
- Cloudflare's optimized fork of zlib
- Libatomic
- Leveraging GCC optimization features
- Creating new tmpfs file-system mounted at /lemp-tmp TODO
- Redis