Thank you! I think it's useful.
I have done some simple tests. But I think general performance test may be meaningless regardless of real world requirements.
os : ubuntu 13.10 64bit
memory: 16G
cpu: intel i7 4700MQ (4 cores 2.4GHz)
1. static file test
file: 29.7k (real contents from
https://groups.drupal.org/node/167984)
ring handler :
(def test-handler [req]
{:status 200
:headers {"content-type" "text/html"}
:body (java.io.File. "resources/index.html") })
warmed by "ab -n 400000 -c 10000 http://localhost:${port}/"
test command:
ab -n 100000 -c 10000 http://localhost:${port}/
(1) nginx-clojure-0.1.0
===================================================================
Document Path: /
Document Length: 29686 bytes
Concurrency Level: 10000
Time taken for tests: 3.464 seconds
Complete requests: 100000
Failed requests: 0
Write errors: 0
Total transferred: 2991200000 bytes
HTML transferred: 2968600000 bytes
Requests per second: 28867.39 [#/sec] (mean)
Time per request: 346.412 [ms] (mean)
Time per request: 0.035 [ms] (mean, across all concurrent requests)
Transfer rate: 843243.63 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 18 113 208.6 74 3082
Processing: 82 219 51.6 225 748
Waiting: 13 78 37.6 70 604
Total: 102 332 216.9 310 3190
Percentage of the requests served within a certain time (ms)
50% 310
66% 329
75% 337
80% 341
90% 348
95% 423
98% 1295
99% 1309
100% 3190 (longest request)
(2) http-kit 2.1.16
=======================================================================
Document Path: /
Document Length: 29686 bytes
Concurrency Level: 10000
Time taken for tests: 4.104 seconds
Complete requests: 100000
Failed requests: 0
Write errors: 0
Total transferred: 2980800000 bytes
HTML transferred: 2968600000 bytes
Requests per second: 24363.92 [#/sec] (mean)
Time per request: 410.443 [ms] (mean)
Time per request: 0.041 [ms] (mean, across all concurrent requests)
Transfer rate: 709218.63 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 49 130 229.3 98 3062
Processing: 124 269 38.6 267 603
Waiting: 39 87 24.0 88 353
Total: 243 398 233.7 369 3665
Percentage of the requests served within a certain time (ms)
50% 369
66% 379
75% 387
80% 395
90% 415
95% 443
98% 1310
99% 1396
100% 3665 (longest request)
(3) ring-jetty
=======================================================================
Document Path: /
Document Length: 29686 bytes
Concurrency Level: 10
Time taken for tests: 4.991 seconds
Complete requests: 100000
Failed requests: 0
Write errors: 0
Total transferred: 2982200000 bytes
HTML transferred: 2968600000 bytes
Requests per second: 20037.89 [#/sec] (mean)
Time per request: 0.499 [ms] (mean)
Time per request: 0.050 [ms] (mean, across all concurrent requests)
Transfer rate: 583564.46 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.0 0 1
Processing: 0 0 0.8 0 75
Waiting: 0 0 0.8 0 75
Total: 0 0 0.8 0 75
Percentage of the requests served within a certain time (ms)
50% 0
66% 1
75% 1
80% 1
90% 1
95% 1
98% 1
99% 1
100% 75 (longest request)
2. simple string
warmed by "ab -n 400000 -c 10000 http://localhost:${port}/"
ring handler :
(def test-handler [req]
{:status 200
:headers {"content-type" "text/html"}
:body "Hello, Clojure!" })
test command:
ab -n 100000 -c 10000 http://localhost:${port}/
(1) nginx-clojure-0.1.0
======================================================================
Document Path: /
Document Length: 15 bytes
Concurrency Level: 10
Time taken for tests: 1.952 seconds
Complete requests: 100000
Failed requests: 0
Write errors: 0
Total transferred: 17000000 bytes
HTML transferred: 1500000 bytes
Requests per second: 51241.03 [#/sec] (mean)
Time per request: 0.195 [ms] (mean)
Time per request: 0.020 [ms] (mean, across all concurrent requests)
Transfer rate: 8506.81 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.0 0 1
Processing: 0 0 0.1 0 3
Waiting: 0 0 0.1 0 3
Total: 0 0 0.1 0 4
Percentage of the requests served within a certain time (ms)
50% 0
66% 0
75% 0
80% 0
90% 0
95% 0
98% 0
99% 0
100% 4 (longest request)
(2) http-kit 2.1.16
=======================================================================
Document Path: /
Document Length: 15 bytes
Concurrency Level: 10
Time taken for tests: 2.424 seconds
Complete requests: 100000
Failed requests: 0
Write errors: 0
Total transferred: 13400000 bytes
HTML transferred: 1500000 bytes
Requests per second: 41258.40 [#/sec] (mean)
Time per request: 0.242 [ms] (mean)
Time per request: 0.024 [ms] (mean, across all concurrent requests)
Transfer rate: 5399.05 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.0 0 1
Processing: 0 0 0.1 0 4
Waiting: 0 0 0.1 0 3
Total: 0 0 0.1 0 5
Percentage of the requests served within a certain time (ms)
50% 0
66% 0
75% 0
80% 0
90% 0
95% 0
98% 0
99% 0
100% 5 (longest request)
(3) ring-jetty
=========================================================================
Document Path: /
Document Length: 15 bytes
Concurrency Level: 10
Time taken for tests: 3.445 seconds
Complete requests: 100000
Failed requests: 0
Write errors: 0
Total transferred: 16700000 bytes
HTML transferred: 1500000 bytes
Requests per second: 29030.44 [#/sec] (mean)
Time per request: 0.344 [ms] (mean)
Time per request: 0.034 [ms] (mean, across all concurrent requests)
Transfer rate: 4734.46 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.0 0 1
Processing: 0 0 0.1 0 4
Waiting: 0 0 0.1 0 4
Total: 0 0 0.1 0 4
Percentage of the requests served within a certain time (ms)
50% 0
66% 0
75% 0
80% 0
90% 0
95% 0
98% 1
99% 1
100% 4 (longest request)