Linux defaults for the listen queue, file limits and the conntrack table are smaller than a busy web server needs. Start with network tuning, then work through file limits, DNS, memory and huge pages. Start with Linux Network Tuning for Web Servers.
- Alpine DNS Issues, musl Timeouts and Kubernetes ndots
Lower Kubernetes ndots, cache DNS on each node and use full names, so the musl resolver in Alpine images stops failing lookups at peak.
- Out of Memory Killed Process on Linux, Fix the OOM Killer
Cap each service's memory, add a little swap and set OOM scores, so the Linux OOM killer stops the process you can lose instead of your app.
- Tuned Profiles on RHEL, and When They Override Sysctls
Check which tuned profile runs, keep sysctls in /etc/sysctl.d and carry the rest in a custom profile, so a reboot or tuned restart can't undo your tuning.
- Possible SYN Flooding on Port, Monitor the SYN Backlog
Alert on SYN cookie and listen queue counters and size the listen backlog, not tcp_max_syn_backlog, so peak traffic stops tripping SYN flood warnings.
- Systemd LimitNOFILE, Fix Open File Limits for Services
limits.conf isn't applied to a systemd service, so set LimitNOFILE in a drop-in, restart the unit and read the new limit back from /proc.
- Disable Transparent Huge Pages for Redis and Databases
Set transparent huge pages to madvise at boot, so Redis forks and database page faults stop stalling at peak while apps that want huge pages can still ask.
- Linux Network Tuning for Web Servers
Size the listen queue, file limits, port range and conntrack table to your peak, so a busy web server or proxy keeps accepting connections.