Day: 2015年4月21日

Nginx优化教程 实现突破十万并发

[摘要]Nginx是一个高性能的 HTTP 和 反向代理 服务器,也是一个 IMAP/POP3/SMTP 代理服务器。本文介绍一些Nginx优化代码参数等。

nginx指令中的优化(配置文件)

worker_processes 8;

nginx进程数,建议按照cpu数目来指定,一般为它的倍数。

worker_cpu_affinity 00000001 00000010 00000100 00001000 00010000 00100000 01000000 10000000;

为每个进程分配cpu,上例中将8个进程分配到8个cpu,当然可以写多个,或者将一个进程分配到多个cpu。

    

centos 安装编译erlang

cd /opt
ls
wget http://www.erlang.org/download/otp_src_17.5.tar.gz
tar zvxf otp_src_17.5.tar.gz
cd otp_src_17.5
yum install unixODBC-devel
./otp_build autoconf (安装最新版:opt_22需要加这行)
./configure --prefix=/opt/erlang --without-javac
make
make install
vi /etc/profile
export PATH=$PATH:/opt/erlang/bin
source /etc/profile(使修改生效)
erl

 

如果

出现错误大致为:  No curses library functions found
5. 需要安装ncurses   :