码迷,mamicode.com
首页 > Web开发 > 详细

apache nginx 性能简单对比测试

时间:2017-03-08 01:29:29      阅读:182      评论:0      收藏:0      [点我收藏+]

标签:apache   nginx   

VPC

32 cpus,8G ram,SSD

linux 环境是centos 7

apache 2.4  yum安装base库

php 5.4    yum安装base库

php-fpm 5.4 yum安装base库

nginx 1.10  yum安装epel库

windows 环境是 windows server 2012R2

apache 2.4

php   5.5


测试phpinfo,

<?php phpinfo();?>


ab压力测试,32线程,共1024000个链接,性能对比如下


linux apache php

Concurrency Level:      32

Time taken for tests:   122.010 seconds

Complete requests:      1024000

Failed requests:        102711

   (Connect: 0, Receive: 0, Length: 102711, Exceptions: 0)

Write errors:           0

Total transferred:      42976140870 bytes

HTML transferred:       42788748870 bytes

Requests per second:    8392.73 [#/sec] (mean)

Time per request:       3.813 [ms] (mean)

Time per request:       0.119 [ms] (mean, across all concurrent requests)

Transfer rate:          343978.17 [Kbytes/sec] received


windows apache php

Concurrency Level:      32

Time taken for tests:   280.478 seconds

Complete requests:      1024000

Failed requests:        105718

   (Connect: 0, Receive: 0, Length: 105718, Exceptions: 0)

Write errors:           0

Total transferred:      85580685230 bytes

HTML transferred:       85461901230 bytes

Requests per second:    3650.91 [#/sec] (mean)

Time per request:       8.765 [ms] (mean)

Time per request:       0.274 [ms] (mean, across all concurrent requests)

Transfer rate:          297973.35 [Kbytes/sec] received


linux nginx php-fpm

Concurrency Level:      32

Time taken for tests:   130.657 seconds

Complete requests:      1024000

Failed requests:        104256

   (Connect: 0, Receive: 0, Length: 104256, Exceptions: 0)

Write errors:           0

Total transferred:      38909836092 bytes

HTML transferred:       38758284092 bytes

Requests per second:    7837.32 [#/sec] (mean)

Time per request:       4.083 [ms] (mean)

Time per request:       0.128 [ms] (mean, across all concurrent requests)

Transfer rate:          290821.98 [Kbytes/sec] received


在都是默认配置的情况下,linux性能确实好很多,apache能跑到每秒8392次响应,但nginx没有想象中性能高,只有每秒7837次响应,可能是没有优化好。windows apache 垫底,只有每秒3650次响应。

本文出自 “专注打孔100年” 博客,请务必保留此出处http://titandeng.blog.51cto.com/823817/1904055

apache nginx 性能简单对比测试

标签:apache   nginx   

原文地址:http://titandeng.blog.51cto.com/823817/1904055

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!