優化Debian上Apache2的內存使用可從以下方面入手:
autoindex、rewrite),減少內存占用。event模式更適合高并發)。StartServers、Min/MaxSpareServers、MaxRequestWorkers等參數,避免進程過多。mod_cache和mod_disk_cache緩存靜態內容。KeepAlive并合理設置KeepAliveTimeout,減少連接開銷。MaxConnectionsPerChild,防止單個進程占用過多內存。vm.swappiness)控制內存交換傾向。top/htop監控內存使用,定期重啟Apache釋放內存。