accept filter on Freebsd

apache 2.15 以上的版本支持 accept filter,其机理是在核心层次上缓冲整个数据包或者 http 请求,一旦整个数据包或者 http 请求完成,则由核心发送到服务器,目前只有 Freebsd 的 Accept Filters 和 Linux 的 TCP_DEFER_ACCEPT 被支持。

#在内核中加入如下内容,重新编译内核
options ACCEPT_FILTER_HTTP
options ACCEPT_FILTER_DATA
#编译内核是一件很费时的事,如果不想这么做,也可在 /boot/loader.conf 中加入如下内容
accf_http_load="YES"
accf_data_load="YES"
#在 /usr/local/etc/apache22/httpd.conf 中加入如下内容
AcceptFilter http httpready
AcceptFilter https dataready
#在 /etc/rc.conf 加入如下内容
apache22_http_accept_enable="YES"
#重启 apache 或者重新开机
apachectl graceful

Tags: ,

This entry was posted on Monday, April 23rd, 2007 at 9:04 pm and is filed under bsd. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Posts you may enjoy

Leave a Reply

Please copy the string BtAvQ3 to the field below: