25个Apache性能优化技巧推荐

Apache至今仍处于web服务器领域的霸主,无人撼动,没有开发者不知道。本篇文章介绍25个Apache性能优化的技巧,如果你能理解并掌握,将让你的Apache性能有显著的提升!

Apache部分:

  • 1. 移除不用的模块。
  • 2. 使用 mod_disk_cache NOT mod_mem_cache 。
  • 3. 扁平架构配置mod_disk_cache。
  • 4. 安装恰当的Expires, Etag, 和 Cache-Control Headers 。
  • 5. 将缓存放在独立的磁盘
  • 6. 使用管道日志替代直接记录
  • 7. 将日志放在不同的磁盘
  • 8. 使用 mod_gzip/mod_deflate 。
  • 9. 将HostnameLookups关闭.
  • 10. 避免在configs中使用主机名。
  • 11. 使用持久连接。
  • 12. 不要设置KeepAliveTimeout太高。
  • 13. 禁用.htaccess。
  • 14. 允许symlinks。
  • 15. 关闭ExtendedStatus。
  • 16. 避免在DirectoryIndex中通配符。

OS 部分:

  • 17. 提高Swappiness。
  • 18. 提高写入缓冲器( Write Buffer)大小。
  • 19. 提高最大打开文件。

应用部分:

    20. 设置图像和样式表的前端代理。
  • 21. 使用mod_passenger for rails。
  • 22. 关闭safe_mode for php。
  • 23. 不要使用threaded mpm with mod_php。
  • 24. 刷新缓冲区预渲染。
  • 25. 频繁访问的数据设置缓存。

原文:http://blog.monitis.com/index.php/2011/07/05/25-apache-performance-tuning-tips/
中文翻译:http://sd.csdn.net/a/20110707/301263.html

标签:Apache 发布于:2019-11-24 14:56:09