Nginx/Golang/Swoole/Node.js�����ܶԱ�

ͨ��ab���߷ֱ�ѹ��nginx swoole node.js golang��http server�����۲����� web server�������һ��It work! Ӳ��������һ̨8G/4�˿��I5CPU�ıʼDZ����ԣ��ͺ���Thinkpad T430.

Nginx   ab -c 100 -n 100000 http://localhost/index.html
Swoole  ab -c 100 -n 100000 http://127.0.0.1:8848/
Node.js ab -c 100 -n 100000 http://127.0.0.1:8080/
Golang  ab -c 100 -n 100000 http://127.0.0.1:8080/

���β���ʹ�õ�����汾���£�

nginx version: nginx/1.2.6 (Ubuntu)
go version go1.1.1 linux/amd64
swoole-1.5.4
node.js-0.11.3-pre

������./codeĿ¼�С�

QPS�Ա�

Nginx:      Requests per second:    23770.74 [#/sec] (mean)
Golang:     Requests per second:    21807.00 [#/sec] (mean)
Swoole:     Requests per second:    19711.22 [#/sec] (mean)
Node.js:    Requests per second:    6680.53 [#/sec] (mean)

�ڴ�ռ�öԱ�

Golang ���ж��ѹ����ڴ��2920K������5580K���ټ���ѹ�ⲻ������

Node.js���ж�κ��ڴ�һֱ���ǣ���������΢�ڴ�й¶���ӿ�ʼ���е�5930K��������6060K��

Nginx��4��worker���̣��ڴ�ռ��һֱ�ȶ���820K��

Swoole���������ڴ�ռ��һֱ�ȶ���3200K�����ѹ���ڴ�ռ��û���κ����ӡ�Worker���̵��ڴ���С�����ӡ�

ͨ������Swoole��max_request������worker���̵����������ǿ��Կ��Ƶģ��������ڽ�������Զ����������ڴ棬������΢���ڴ�й¶����Ҳ����

TCP�����ӵ�ά������

Nginx��Golang��Swoole��node.js����ʹ��epoll/kqueue��Ϊ�¼���ѯ���Ƶġ�ά�ֶ��ٳ������������뱾��û���κι�ϵ��ȡ���ڲ���ϵͳ���ڴ��С��

�������

Nginx��Golang��Swoole���Ƕ��߳�Reactor�ģ����Գ�����ö�ˣ����Գɼ���node.js�������� Swoole�е�PHP������Ҫ����Ϊopcode��ִ�У�ÿ��opcode����һ�κ������á����Ե�ִ��Ч��Ч�ʱ�C���ԣ�Nginx��,Golang���ֱ����͵����Բ�һЩ�� Node.js��httpģ�鲻�Ƕ��̵߳ģ��޷����ö�ˣ���������ﲢ����˵node.js�����ܲʹ�õ�������node��չclusterҲ����ʹnode.js��ɶ���̡�

�����µ�swoole-1.7.6+�汾�У���׼ѹ������swoole�����Ƕ����ӻ��dz����ӣ����ѳ�����Golang������һ���汾�����󣬽������·������ܲ��Ա��档