LNMP是指Linux系统下Nginx+MySQL+PHP(或Perl、Python)这种网站服务器架构。以下是优化Debian上LNMP性能的步骤:
opcache.enable=1
opcache.interned_strings_buffer=64
opcache.max_accelerated_files=10000
opcache.memory_consumption=256
opcache.save_comments=1
opcache.fast_shutdown=1
opcache.jit=on
opcache.jit_buffer_size=128
innodb_buffer_pool_size
,通常设置为系统内存的50%-80%。max_connections
以匹配服务器的处理能力。query_cache_size
和query_cache_type
。ulimit -n 65535
提高文件描述符限制。sysctl -w net.core.somaxconn=65535
net.ipv4.ip_local_port_range = 1024 65535
net.ipv4.tcp_fin_timeout = 30
net.ipv4.tcp_slow_start_after_idle = 0
net.ipv4.tcp_fastopen = 3
net.ipv4.tcp_syncookies = 1
net.core.netdev_max_backlog = 65535
net.nf_conntrack_max=2097152
以上步骤可以帮助你优化Debian上的LNMP性能。请根据你的具体需求和硬件配置进行调整。
亿速云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>
相关推荐:Debian LNMP性能如何优化