我想在FreeBSD上使用nginx上的asynchronousIO。 我看到很多关于如何configuration它或者如何编译nginx的文档。
不过,我已经安装了nginx,所以我需要重新编译启用aio的nginx。 重新编译的部分是我不知道该怎么做的。
我正在使用FreeBSD 8提供的nginx(v0.7.67)端口。
有谁能够帮助我?
首先,您需要将AIO支持添加到FreeBSD。 你可以使用两种方法来做到这一点。 1)添加“选项VFS_AIO”并重build内核。 2)通过可加载内核模块dynamic加载AIO:kldload aio
在这之后添加这行到configuration:
location /video/ { sendfile off; aio on; output_buffers 1 64k; }
您可以使用sendfile for AIO:
location /video/ { sendfile on; tcp_nopush on; aio sendfile; }
这两个变种将工作。
在FreeBSD上启用nginx文件aio支持的最简单方法是通过ports树安装nginx,并在对话框中selectFILE_AIO选项。
portsnap fetch extract cd /usr/ports/www/nginx make install clean
但是,如果您想自己编译它,请下载源代码,然后解压:
./configure --with-file-aio make install
(你需要运行两个portsnap并以root身份进行安装 !)