我对Linux、FreeBSD和NetBSD之间web服务器性能的差异很感兴趣,因为我听说NetBSD和FreeBSD具有良好的TCP/IP实现。
因此,我在KVM上设置了具有相同硬件功能( CPU、RAM:2G、HDD:16G、NIC:virtio)的VM,然后分别为Nginx安装必要的软件包。
我只是在ramdisk上运行带有静态主页的简单Nginx (为了防止磁盘I/O因素)。
我发现NetBSD的性能很差。我怀疑NetBSD的基本设置是保守的,所以我尝试调优一些系统参数。但是,很少有关于NetBSD系统调优的资源。虽然与FreeBSD相比,我调优了一些sysctl参数,但仍然不是更好。
是否有任何NetBSD调优建议或NetBSD真的不是web服务器的好选择?
下面是我的apache基准测试结果:
ab -r -n 10000 -c 500
Server Software: LINUX nginx/1.9.3
Server Hostname: 10.128.81.63
Server Port: 80
Document Path: /
Document Length: 612 bytes
Concurrency Level: 500
Time taken for tests: 0.823 seconds
Complete requests: 10000
Failed requests: 0
Total transferred: 8440000 bytes
HTML transferred: 6120000 bytes
Requests per second: 12155.16 [#/sec] (mean)
Time per request: 41.135 [ms] (mean)
Transfer rate: 10018.51 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.5 0 4
Processing: 2 16 78.2 8 817
Waiting: 1 16 78.2 8 817
Total: 6 16 78.4 8 819
------------------------------------------------------------
Server Software: FreeBSD nginx/1.9.3
Server Hostname: 10.128.81.67
Server Port: 80
Document Path: /
Document Length: 612 bytes
Concurrency Level: 500
Time taken for tests: 0.443 seconds
Complete requests: 10000
Failed requests: 0
Total transferred: 8440000 bytes
HTML transferred: 6120000 bytes
Requests per second: 22577.85 [#/sec] (mean)
Time per request: 22.146 [ms] (mean)
Transfer rate: 18609.09 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.5 0 3
Processing: 3 21 7.7 21 214
Waiting: 3 21 7.7 21 214
Total: 6 22 7.6 22 217
------------------------------------------------------------
Server Software: NetBSD nginx/1.9.3
Server Hostname: 10.128.81.69
Server Port: 80
Document Path: /
Document Length: 612 bytes
Concurrency Level: 500
Time taken for tests: 1.350 seconds
Complete requests: 10000
Failed requests: 373
(Connect: 0, Receive: 144, Length: 85, Exceptions: 144)
Total transferred: 8318464 bytes
HTML transferred: 6031872 bytes
Requests per second: 7410.05 [#/sec] (mean)
Time per request: 67.476 [ms] (mean)
Transfer rate: 6019.56 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 29 166.9 0 1003
Processing: 1 20 13.9 19 224
Waiting: 0 20 13.9 19 224
Total: 4 49 169.3 20 1212发布于 2015-11-03 11:52:08
您正在使用KVM --请注意,(AFAIK)在NetBSD下仍然很不稳定。
我认为这解释了Linux和FreeBSD (两者都支持virtio )和NetBSD之间的性能差异。
https://serverfault.com/questions/732667
复制相似问题