--
with kind regards --
邮件自: 列表“openresty”,专用于技术讨论!
发言: 请发邮件到 open...@googlegroups.com
退订: 请发邮件至 openresty+...@googlegroups.com
详情: http://groups.google.com/group/openresty
官网: http://openresty.org/
仓库: https://github.com/agentzh/ngx_openresty
建议: 提问的智慧 http://wiki.woodpecker.org.cn/moin/AskForHelp
教程: http://agentzh.org/misc/nginx/agentzh-nginx-tutorials-zhcn.html
2012/12/16 Zheng Ping:
>
> 我自己的机器上的openresty编辑指令:
> ./configure --prefix=/home/zhen/app/openresty --with-luajit --user=zhen
> --group=zhen --pid-path=/home/zhen/temp/nginx/openresty.pid
> --error-log-path=/home/zhen/temp/openresty_error.log
>
> 我编译下来的nginx有11M之多,我如果要把他部署到生产环境,
> 是不是还需要哪些特殊的编译参数啊?
值得指出的是,nginx 的构建系统默认是启用可执行文件中的调试符号的,你的 nginx 可执行文件中当有近 90% 的内容是调试符号。
这些调试信息并不会对 nginx 进程的内存占用大小造成什么影响。现代操作系统是按需读取可执行文件中的这些调试信息的。
你可以使用 strip 命令除去你的 nginx 可执行文件中的调试符号,这应当可以把可执行文件的大小减低到 1MB 左右(在我的
Linux x86_64 系统上,默认构造出来的 nginx 可执行文件在 strip 之后只有 996KB)。但我不建议你手动
strip,因为这会让你的 nginx 无法通过 gdb 或者 systemtap 这样的工具调试问题。
如果你真的在意,可以使用 ./configure --help 得到那些 --without-http_xxxx_module
的选项列表。使用这些选项禁用你并没有使用到的模块,可以减小 nginx 可执行文件的大小。
Best regards,
-agentzh