开发者

Does mod_deflate increase apache memory consumption?

My webserver is running out of memory evry now and then. As optimization process, I enabled mod_deflate to compress content. Now I am not sure if it further aggravates the issues with memory. Does mod_deflate increase memory consumption of apache? I don't want further crashes due to memory.

Below is the cmd I am using to get the memory consumption o开发者_运维知识库f each child of apache,

MEMUSE=top -b -n 1 | grep [h]ttpd | awk '{ print $6 }' | grep m | sed 's/m//' |awk '{ x+=$1 ; print x }' | tail -1 ; CHILDCOUNT=ps aux|grep [h]ttpd | wc -l ; echo "scale=2; ($MEMUSE)/$CHILDCOUNT" | bc

I actually want to know if the tradeoff is worth?

Thanks


One ongoing compression consumes roughly 300 kilobytes of memory for zlib + probably requires the server to hold both the uncompressed and compressed versions briefly in memory. The resources consumed by zlib are freed after compression. Whether that causes you a problem or not depends on your memory amount and the rate of hits to resources that require compression. For most servers however mod_deflate should not cause major issues. The speedup from mod_deflate with html files (and text files generally) is noticeable in many cases so it is usually worth the extra resource requirements.

If you combine the mod_deflate especially with mod_cache* in correct order (the modules are being run in the loading order) you might be able to lower the memory consumption slightly because compression wouldn't have to be done every single hit on resource. This however requires some testing to accomplish.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜