Skip to content

Instantly share code, notes, and snippets.

@g13n
Last active August 29, 2015 13:56
Show Gist options
  • Save g13n/9130133 to your computer and use it in GitHub Desktop.
Save g13n/9130133 to your computer and use it in GitHub Desktop.
# httperf Web Server Benchmarking
## The Network
### Server
$ iperf -s
------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 85.3 KByte (default)
------------------------------------------------------------
[ 4] local 172.31.0.104 port 5001 connected with 172.31.18.243 port 48749
[ ID] Interval Transfer Bandwidth
[ 4] 0.0-10.1 sec 172 MBytes 143 Mbits/sec
### The Client
$ iperf -c ip-172-31-0-104
------------------------------------------------------------
Client connecting to ip-172-31-0-104, TCP port 5001
TCP window size: 23.5 KByte (default)
------------------------------------------------------------
[ 3] local 172.31.18.243 port 48749 connected with 172.31.0.104 port 5001
[ ID] Interval Transfer Bandwidth
[ 3] 0.0-10.0 sec 172 MBytes 144 Mbits/sec
$ $ ulimit -n
32768
## PHP+APC (Apache)
### The Code
hello, world
### The Results
$ ./src/httperf --client 0/1 --server ip-172-31-0-104 --uri /hello.php --num-conns 10000 --num-calls 10 --rate 100 --timeout 1
httperf --timeout=1 --client=0/1 --server=ip-172-31-0-104 --port=80 --uri=/hello.php --rate=100 --send-buffer=4096 --recv-buffer=16384 --num-conns=10000 --num-calls=10
Maximum connect burst length: 12
Total: connections 10000 requests 91472 replies 89679 test-duration 100.818 s
Connection rate: 99.2 conn/s (10.1 ms/conn, <=194 concurrent connections)
Connection time [ms]: min 16.0 avg 1116.5 max 3588.5 median 1082.5 stddev 554.9
Connection time [ms]: connect 3.5
Connection length [replies/conn]: 9.369
Request rate: 907.3 req/s (1.1 ms/req)
Request size [B]: 77.0
Reply rate [replies/s]: min 512.8 avg 889.8 max 1000.1 stddev 127.0 (20 samples)
Reply time [ms]: response 102.4 transfer 0.0
Reply size [B]: header 193.0 content 13.0 footer 0.0 (total 206.0)
Reply status: 1xx=0 2xx=89679 3xx=0 4xx=0 5xx=0
CPU time [s]: user 16.25 system 84.55 (user 16.1% system 83.9% total 100.0%)
Net I/O: 247.2 KB/s (2.0*10^6 bps)
Errors: total 1794 client-timo 1794 socket-timo 0 connrefused 0 connreset 0
Errors: fd-unavail 0 addrunavail 0 ftab-full 0 other 0
## HHVM
### The Code
hello, world
### The Results
$ ./src/httperf --client 0/1 --server ip-172-31-0-104 --uri /hello.php --num-conns 10000 --num-calls 10 --rate 100 --timeout 1
httperf --timeout=1 --client=0/1 --server=ip-172-31-0-104 --port=80 --uri=/hello.php --rate=100 --send-buffer=4096 --recv-buffer=16384 --num-conns=10000 --num-calls=10
Maximum connect burst length: 13
Total: connections 10000 requests 96727 replies 96327 test-duration 101.139 s
Connection rate: 98.9 conn/s (10.1 ms/conn, <=159 concurrent connections)
Connection time [ms]: min 16.0 avg 972.2 max 2881.3 median 961.5 stddev 573.8
Connection time [ms]: connect 2.1
Connection length [replies/conn]: 9.976
Request rate: 956.4 req/s (1.0 ms/req)
Request size [B]: 77.0
Reply rate [replies/s]: min 859.7 avg 954.6 max 1000.3 stddev 30.8 (20 samples)
Reply time [ms]: response 96.6 transfer 0.0
Reply size [B]: header 136.0 content 13.0 footer 0.0 (total 149.0)
Reply status: 1xx=0 2xx=96327 3xx=0 4xx=0 5xx=0
CPU time [s]: user 18.47 system 82.39 (user 18.3% system 81.5% total 99.7%)
Net I/O: 210.5 KB/s (1.7*10^6 bps)
Errors: total 401 client-timo 401 socket-timo 0 connrefused 0 connreset 0
Errors: fd-unavail 0 addrunavail 0 ftab-full 0 other 0
## Node.js
### The Code
var http = require('http');
http.createServer(function (req, res) {
res.end('hello, world');
}).listen(80);
### The Results
$ ./src/httperf --client 0/1 --server ip-172-31-0-104 --uri / --num-conns 10000 --num-calls 10 --rate 100 --timeout 1
httperf --timeout=1 --client=0/1 --server=ip-172-31-0-104 --port=80 --uri=/ --rate=100 --send-buffer=4096 --recv-buffer=16384 --num-conns=10000 --num-calls=10
Maximum connect burst length: 12
Total: connections 10000 requests 98437 replies 98157 test-duration 100.387 s
Connection rate: 99.6 conn/s (10.0 ms/conn, <=151 concurrent connections)
Connection time [ms]: min 14.8 avg 690.3 max 3121.5 median 720.5 stddev 348.1
Connection time [ms]: connect 12.9
Connection length [replies/conn]: 9.897
Request rate: 980.6 req/s (1.0 ms/req)
Request size [B]: 68.0
Reply rate [replies/s]: min 898.9 avg 977.2 max 1051.1 stddev 37.1 (20 samples)
Reply time [ms]: response 66.3 transfer 0.0
Reply size [B]: header 71.0 content 12.0 footer 2.0 (total 85.0)
Reply status: 1xx=0 2xx=98157 3xx=0 4xx=0 5xx=0
CPU time [s]: user 18.53 system 81.84 (user 18.5% system 81.5% total 100.0%)
Net I/O: 144.4 KB/s (1.2*10^6 bps)
Errors: total 284 client-timo 284 socket-timo 0 connrefused 0 connreset 0
Errors: fd-unavail 0 addrunavail 0 ftab-full 0 other 0
@g13n
Copy link
Author

g13n commented Feb 21, 2014

This is not a real benchmark for any web server/library. I wanted to quickly check the raw overhead for a simple "hello, world".
For a true benchmark, read http://www.mnot.net/blog/2011/05/18/http_benchmark_rules.

Hardware Config:

$ cat /proc/cpuinfo 
processor   : 0
vendor_id   : GenuineIntel
cpu family  : 6
model       : 45
model name  : Intel(R) Xeon(R) CPU E5-2650 0 @ 2.00GHz
stepping    : 7
microcode   : 0x70d
cpu MHz     : 1795.672
cache size  : 20480 KB
physical id : 1
siblings    : 1
core id     : 5
cpu cores   : 1
apicid      : 42
initial apicid  : 42
fpu     : yes
fpu_exception   : yes
cpuid level : 13
wp      : yes
flags       : fpu de tsc msr pae cx8 sep cmov pat clflush mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc up rep_good nopl nonstop_tsc pni pclmulqdq ssse3 cx16 pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes avx hypervisor lahf_lm
bogomips    : 3591.34
clflush size    : 64
cache_alignment : 64
address sizes   : 46 bits physical, 48 bits virtual
power management:

$ cat /proc/meminfo 
MemTotal:         604328 kB
MemFree:          139752 kB
Buffers:           29908 kB
Cached:           355252 kB
SwapCached:            0 kB
Active:           215864 kB
Inactive:         192348 kB
Active(anon):      23184 kB
Inactive(anon):       48 kB
Active(file):     192680 kB
Inactive(file):   192300 kB
Unevictable:           0 kB
Mlocked:               0 kB
SwapTotal:             0 kB
SwapFree:              0 kB
Dirty:                 0 kB
Writeback:             0 kB
AnonPages:         23084 kB
Mapped:             7500 kB
Shmem:               180 kB
Slab:              41244 kB
SReclaimable:      34220 kB
SUnreclaim:         7024 kB
KernelStack:         504 kB
PageTables:         2084 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:      302164 kB
Committed_AS:      69104 kB
VmallocTotal:   34359738367 kB
VmallocUsed:        7152 kB
VmallocChunk:   34359729008 kB
HardwareCorrupted:     0 kB
AnonHugePages:         0 kB
HugePages_Total:       0
HugePages_Free:        0
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB
DirectMap4k:      637952 kB
DirectMap2M:           0 kB

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment