Swoole與PHP-FPM性能對比

| Comments

測試環境:

  • CPU: Intel(R) Core(TM) i5-3470 CPU @ 3.20GHz
  • MEM: 4G
  • OS: Archlinux 64bit

測試命令:

1
ab -c 200 -n 200000 -k http://127.0.0.1/test

NGINX + PHP-FPM

Requests per second: 16240.50 [#/sec] (mean)
Time per request: 12.315 [ms] (mean)

NGINX + Swoole

Requests per second: 31284.57 [#/sec] (mean)
Time per request: 6.393 [ms] (mean)

Swoole

Requests per second: 99926.55 [#/sec] (mean)
Time per request: 2.001 [ms] (mean)

結論

對一個最簡單的PHP腳本做測試,排除業務邏輯的消耗的影響。Swoole威武。

Comments