【问题标题】:Mod deflate: Server taking more resources after enabling compression in httpd.confMod deflate:在 httpd.conf 中启用压缩后服务器占用更多资源
【发布时间】:2015-08-19 09:35:36
【问题描述】:

我在 httpd.conf 中添加了以下 sn-p

 # mod_deflate configuration
<IfModule mod_deflate.c>

# Restrict compression to these MIME types
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE text/javascript
AddOutputFilterByType DEFLATE text/css

# Level of compression (Highest 9 - Lowest 1)
DeflateCompressionLevel 1

# Netscape 4.x has some problems.
BrowserMatch ^Mozilla/4 gzip-only-text/html

# Netscape 4.06-4.08 have some more problems
BrowserMatch ^Mozilla/4\.0[678] no-gzip

# MSIE masquerades as Netscape, but it is fine
BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html

</IfModule>

压缩工作非常好,但是服务器响应请求的时间太长,我也检查了top 命令,它显示 99% 的 cpu 使用率。 我怎样才能使这种压缩更有效?或任何其他可能有助于进一步分析的命令?

【问题讨论】:

    标签: apache compression gzip httpd.conf deflate


    【解决方案1】:

    如果响应是可缓存的,则添加 mod_expires 和 mod_cache+mod_disk_cache 以动态缓存压缩的变体。

    【讨论】:

      猜你喜欢
      • 2013-05-05
      • 2012-01-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-12-31
      • 2021-02-24
      • 2012-12-02
      相关资源
      最近更新 更多