3

I am interesting in the difference web server performance between Linux, FreeBSD and NetBSD since I have heard that NetBSD and FreeBSD have the good TCP/IP implementation.
As the result, I setup VMs with same hardware capability (2 CPU, RAM:2G, HDD:16G, NIC:virtio) on KVM, and then install essential packages for Nginx respectively.
I just ran simple Nginx with static homepage on ramdisk (for preventing disk I/O factor).

I found that the performance of NetBSD is very bad. I suspect that the basic setting of NetBSD is conservative, so I try to tune some system parameters. However, it's very few resource talking about NetBSD system tuning. Although I tune some sysctl parameters by comparing to FreeBSD, it still not be better.

Is there any NetBSD tuning advice or NetBSD is really not a good choice for web server?

Below is my apache-benchmark result:
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
  • 3
    If the ultimate goal is VM webservers running on a similar host system, OK, you may learn some things... but if network performance comparison is your only goal, be aware the network performance of the virtual clients may be impacted in hard-to-define ways by the network implementation of the host and/or the VM software. – kmarsh Oct 30 '15 at 15:02
  • So, maybe the performance is caused by the support level to VM between different OS? In my first thought, I thought the OSs in the same settings in a VM are equal. If like you say, I should run these OS in a bare metal? – Ray Shih Oct 31 '15 at 9:47
  • You also apparently used a different concurrency level for the reported FreeBSD test. Why? What if you use the exact same parameters? – Greg A. Woods Oct 31 '15 at 19:43
  • Yes, a bare-metal test for each OS would also be quite interesting. – Greg A. Woods Oct 31 '15 at 19:44
  • 1
    @GregA.Woods , sorry, I forgot to update the FreeBSD result. FreeBSD limit the concurrency level on default settings due to the sysctl value kern.ipc.somaxconn =128. After putting on the value, FreeBSD can bear the concurrency level. – Ray Shih Nov 2 '15 at 1:56
4

You are using KVM -- Please be aware that virtio support may still (AFAIK) be pretty patchy under NetBSD.

I think this explains the performance difference between Linux and FreeBSD (both have virtio support) and NetBSD.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.