有人在Raspi上进行过一些Web服务器基准测试吗?我还没有Raspi,但我正计划将其用作Web服务器,我有兴趣查看以下各项的统计信息:


每秒请求数
请求之间的延迟响应时间
吞吐量(即每秒字节数)

如果不同的Web服务器软件和OS组合的延迟时间不同,我也希望进行比较。 />

评论

投票结束可以解释为什么吗?这是一个客观的问题,带有一个客观可衡量的答案。

我不能权威地回答,但我认为一般来说最快的Web服务器将是RPi上最快的。我更喜欢Nginx。

@AlexChamberlain谢谢,很高兴知道,但是我仍然希望看到我可以从设备中获得什么样的性能,所以我不打算将它用于超出其功能的项目...

参见本页:cheapskatesguide.org/articles/raspberry-pi-webserver.html。本文的第一部分讨论了Lighttpd Web服务器的性能。

#1 楼

我希望,正如Alex所说的那样,基准测试将显示出最快的Linux Web服务器仍然是最快的,而不管架构如何。

如果有人想运行基准测试,那么以下教程对我很有用:

如何在Web服务器上执行基准测试


服务静态页面简单的静态页面:

<h1>It works!</h1>



作为控制组,我使用了主要的Web服务器,它携带着以下规格;

Intel(R) Xeon(R) CPU           X3323  @ 2.50GHz
384MB RAM



结果如下:

控制
ab -n 1000 -c 5 http://www.ivings.org.uk/~james/index.html

Server Software:        Apache/2.2.14
Server Hostname:        www.ivings.org.uk
Server Port:            80

Document Path:          /~james/index.html
Document Length:        19 bytes

Concurrency Level:      5
Time taken for tests:   17.767 seconds
Complete requests:      1000
Failed requests:        0
Write errors:           0
Total transferred:      294000 bytes
HTML transferred:       19000 bytes
Requests per second:    56.29 [#/sec] (mean)
Time per request:       88.833 [ms] (mean)
Time per request:       17.767 [ms] (mean, across all concurrent requests)
Transfer rate:          16.16 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:       42   44   0.8     44      50
Processing:    44   45   0.9     45      59
Waiting:       44   45   0.9     45      59
Total:         86   89   1.3     88     108

Percentage of the requests served within a certain time (ms)
  50%     88
  66%     89
  75%     89
  80%     89
  90%     90
  95%     91
  98%     91
  99%     94
 100%    108 (longest request)


Raspberry Pi

ab -n 1000 -c 5 http://86.137.189.68/index.html

Server Software:        Apache/2.2.22
Server Hostname:        86.137.189.68
Server Port:            80

Document Path:          /index.html
Document Length:        19 bytes

Concurrency Level:      5
Time taken for tests:   23.186 seconds
Complete requests:      1000
Failed requests:        0
Write errors:           0
Total transferred:      304000 bytes
HTML transferred:       19000 bytes
Requests per second:    43.13 [#/sec] (mean)
Time per request:       115.930 [ms] (mean)
Time per request:       23.186 [ms] (mean, across all concurrent requests)
Transfer rate:          12.80 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:       40   44   5.6     43     116
Processing:    49   71 156.1     57    2157
Waiting:       47   53   6.7     55     104
Total:         91  116 156.1     99    2198

Percentage of the requests served within a certain time (ms)
  50%     99
  66%    100
  75%    100
  80%    100
  90%    102
  95%    126
  98%    150
  99%    667
 100%   2198 (longest request)



结论

注意:最好将其视为估算值。

结果表明,Raspberry Pi实际上考虑得很好。它的响应速度仅比我的主要Web服务器稍差。

处理相当大量的请求应该很好。

评论


也许是这样,但是最快的速度可以产生什么样的性能?我想你们都误解了我要问的问题...

– AntonChanning
2012年6月13日11:31

我将在apache上执行一些基准测试并与您联系。

–活动
2012年6月13日上午11:32

谢谢。如果我的问题不清楚,我深表歉意。也许当我真正的主要兴趣是标准LAMP堆栈的统计数据时,我就糊涂了,要求比较。

– AntonChanning
2012年6月13日12:05

LAMP中的“ A”代表Apache HTTP服务器...

–罗杰·达尔(Roger Dahl)
2012年10月2日23:18

@Jivings:这是给OP的评论。在对您的帖子的初始评论中,他表示他有兴趣寻找最快的http服务器的性能,并且对基于Apache的基准测试感到不满意。然后,他继续隐式要求Apache基准测试(LAMP中的“ A”)。

–罗杰·达尔(Roger Dahl)
2012年10月3日13:17

#2 楼

在提供静态内容时,Apache不是最佳选择,nginx更适合于此。我使用http://lekensteyn.nl/index.html作为测试文档进行了基准测试。它比Jiving的示例大,因为19字节对于实际页面而言是不现实的。结果非常惊人,RPi甚至胜过我的笔记本电脑(也许是因为我启用了各种内核调试开关)。

这是在Arch Linux上运行的nginx 1.4.1(RPi,access_log off,有线以太网):

$ ab -n 1000 -c 5 http://192.168.2.10/index.html

Server Software:        nginx/1.4.1
Server Hostname:        192.168.2.10
Server Port:            80

Document Path:          /index.html
Document Length:        2159 bytes

Concurrency Level:      5
Time taken for tests:   2.341 seconds
Complete requests:      1000
Failed requests:        0
Write errors:           0
Total transferred:      2392000 bytes
HTML transferred:       2159000 bytes
Requests per second:    427.18 [#/sec] (mean)
Time per request:       11.705 [ms] (mean)
Time per request:       2.341 [ms] (mean, across all concurrent requests)
Transfer rate:          997.86 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    1   0.1      1       1
Processing:     4   11   1.0     11      20
Waiting:        3   11   1.0     10      19
Total:          4   12   1.0     12      21

Percentage of the requests served within a certain time (ms)
  50%     12
  66%     12
  75%     12
  80%     12
  90%     12
  95%     12
  98%     17
  99%     18
 100%     21 (longest request)


这是我的笔记本电脑(access_log off,有线以太网):

Server Software:        nginx/1.4.1
Server Hostname:        192.168.2.12
Server Port:            80

Document Path:          /index.html
Document Length:        2159 bytes

Concurrency Level:      5
Time taken for tests:   2.593 seconds
Complete requests:      1000
Failed requests:        0
Write errors:           0
Total transferred:      2392000 bytes
HTML transferred:       2159000 bytes
Requests per second:    385.62 [#/sec] (mean)
Time per request:       12.966 [ms] (mean)
Time per request:       2.593 [ms] (mean, across all concurrent requests)
Transfer rate:          900.79 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        2    6   3.4      5      82
Processing:     3    7   5.6      6      86
Waiting:        3    7   5.5      5      82
Total:          6   13   6.8     12      94

Percentage of the requests served within a certain time (ms)
  50%     12
  66%     13
  75%     14
  80%     15
  90%     17
  95%     19
  98%     24
  99%     34
 100%     94 (longest request)


完整性,我的远程服务器。 WAN连接可能会成为瓶颈(access_log也未关闭),它的速度较慢:

Server Software:        nginx/1.2.8
Server Hostname:        lekensteyn.nl
Server Port:            80

Document Path:          /index.html
Document Length:        2159 bytes

Concurrency Level:      5
Time taken for tests:   11.074 seconds
Complete requests:      1000
Failed requests:        0
Write errors:           0
Total transferred:      2370000 bytes
HTML transferred:       2159000 bytes
Requests per second:    90.30 [#/sec] (mean)
Time per request:       55.371 [ms] (mean)
Time per request:       11.074 [ms] (mean, across all concurrent requests)
Transfer rate:          209.00 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:       25   27   2.3     26      59
Processing:    28   29   2.3     28      59
Waiting:       26   27   2.4     27      59
Total:         53   55   3.8     55     102

Percentage of the requests served within a certain time (ms)
  50%     55
  66%     55
  75%     55
  80%     55
  90%     56
  95%     57
  98%     59
  99%     86
 100%    102 (longest request)


由于并发性和请求计数更高,因此数字应该更可靠随着可以包含更多样本(当我在有线/无线模式下对笔记本电脑运行ab时,其数量波动很大)。请注意,在使用访问日志进行测试时,当日志目录位于SD卡上时,该文件系统缓冲区会导致不可预知的写入延迟。