Skip to content

Instantly share code, notes, and snippets.

@ngocdaothanh
Created August 8, 2012 08:53
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ngocdaothanh/3293596 to your computer and use it in GitHub Desktop.
Save ngocdaothanh/3293596 to your computer and use it in GitHub Desktop.
Static file serving benchmark: Nginx 1.2.3 VS Xitrum 1.9.2
Condition
=========
Machine spec
------------
Machine 1 and Machine 2: same spec
Red Hat Enterprise Linux 6.3 64 bit
EC2 High-Memory Double Extra Large
34.2 GB of memory
13 EC2 Compute Units (4 virtual cores with 3.25 EC2 Compute Units each)
850 GB of instance storage
64-bit platform
I/O Performance: High
EBS-Optimized Available: No
Nginx 1.2.3 and Xitrum 1.9.2 config
-----------------------------------
Defaults.
Xitrum:
* Scala 2.9.2, Oracle JVM 7u5
* JAVA_OPTS: -server -Xms256m -Xmx1024m -XX:MaxPermSize=128m -XX:+UseParallelGC -Djava.awt.headless=true
httperf
-------
httperf-0.9.0 compiled Nov 11 2010 without DEBUG without TIME_SYSCALLS
File
----
Nginx's default index.html (151 bytes)
Benchmark 1: Nginx, Xitrum, and httperf run on same machine
===========================================================
httperf --client=0/1 --server=localhost --port=8000 --uri=/index.html \
--send-buffer=4096 --recv-buffer=16384 --num-conns=1000 --num-calls=100 --rate 200 --timeout 5
Nginx
-----
Total: connections 1000 requests 100000 replies 100000 test-duration 5.979 s
Connection rate: 167.3 conn/s (6.0 ms/conn, <=187 concurrent connections)
Connection time [ms]: min 9.8 avg 618.2 max 1075.6 median 632.5 stddev 285.6
Connection time [ms]: connect 2.1
Connection length [replies/conn]: 100.000
Request rate: 16725.2 req/s (0.1 ms/req)
Request size [B]: 72.0
Reply rate [replies/s]: min 16797.8 avg 16797.8 max 16797.8 stddev 0.0 (1 samples)
Reply time [ms]: response 6.2 transfer 0.0
Reply size [B]: header 203.0 content 151.0 footer 0.0 (total 354.0)
Reply status: 1xx=0 2xx=100000 3xx=0 4xx=0 5xx=0
CPU time [s]: user 0.63 system 5.35 (user 10.5% system 89.5% total 100.0%)
Net I/O: 6973.5 KB/s (57.1*10^6 bps)
Xitrum
------
Total: connections 1000 requests 100000 replies 100000 test-duration 5.407 s
Connection rate: 184.9 conn/s (5.4 ms/conn, <=141 concurrent connections)
Connection time [ms]: min 15.9 avg 480.0 max 1001.9 median 499.5 stddev 205.1
Connection time [ms]: connect 0.2
Connection length [replies/conn]: 100.000
Request rate: 18494.3 req/s (0.1 ms/req)
Request size [B]: 72.0
Reply rate [replies/s]: min 18579.2 avg 18579.2 max 18579.2 stddev 0.0 (1 samples)
Reply time [ms]: response 4.8 transfer 0.0
Reply size [B]: header 200.0 content 151.0 footer 0.0 (total 351.0)
Reply status: 1xx=0 2xx=100000 3xx=0 4xx=0 5xx=0
CPU time [s]: user 0.53 system 4.55 (user 9.7% system 84.2% total 94.0%)
Net I/O: 7639.7 KB/s (62.6*10^6 bps)
Benchmark 2: Nginx and Xitrum run on a machine, httperf runs on the other
=========================================================================
httperf --client=0/1 --server=machine1 --port=8000 --uri=/index.html \
--send-buffer=4096 --recv-buffer=16384 --num-conns=1000 --num-calls=100 --rate 100 --timeout 5
Nginx
-----
Total: connections 1000 requests 100000 replies 100000 test-duration 10.042 s
Connection rate: 99.6 conn/s (10.0 ms/conn, <=49 concurrent connections)
Connection time [ms]: min 29.9 avg 94.1 max 576.4 median 35.5 stddev 109.3
Connection time [ms]: connect 1.6
Connection length [replies/conn]: 100.000
Request rate: 9957.7 req/s (0.1 ms/req)
Request size [B]: 72.0
Reply rate [replies/s]: min 9947.5 avg 9960.7 max 9973.8 stddev 18.6 (2 samples)
Reply time [ms]: response 0.9 transfer 0.0
Reply size [B]: header 203.0 content 151.0 footer 0.0 (total 354.0)
Reply status: 1xx=0 2xx=100000 3xx=0 4xx=0 5xx=0
CPU time [s]: user 1.64 system 8.40 (user 16.3% system 83.7% total 100.0%)
Net I/O: 4151.8 KB/s (34.0*10^6 bps)
Xitrum
------
Total: connections 1000 requests 100000 replies 100000 test-duration 10.028 s
Connection rate: 99.7 conn/s (10.0 ms/conn, <=9 concurrent connections)
Connection time [ms]: min 35.0 avg 48.8 max 105.1 median 46.5 stddev 9.9
Connection time [ms]: connect 0.3
Connection length [replies/conn]: 100.000
Request rate: 9971.7 req/s (0.1 ms/req)
Request size [B]: 72.0
Reply rate [replies/s]: min 9963.4 avg 9980.1 max 9996.7 stddev 23.5 (2 samples)
Reply time [ms]: response 0.5 transfer 0.0
Reply size [B]: header 200.0 content 151.0 footer 0.0 (total 351.0)
Reply status: 1xx=0 2xx=100000 3xx=0 4xx=0 5xx=0
CPU time [s]: user 1.74 system 8.29 (user 17.3% system 82.6% total 100.0%)
Net I/O: 4119.2 KB/s (33.7*10^6 bps)
@mheath
Copy link

mheath commented Aug 8, 2012

Impressive results thanks for posting this.

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