Skip to content

Instantly share code, notes, and snippets.

@SchumacherFM
Last active August 29, 2015 14:06
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 SchumacherFM/cbe6e7a7ec47606e81b8 to your computer and use it in GitHub Desktop.
Save SchumacherFM/cbe6e7a7ec47606e81b8 to your computer and use it in GitHub Desktop.
GoLang ListenAndServeTLS vs ListenAndServe
HTTPS: Requests per second:    89.07 [#/sec] (mean)
HTTP:  Requests per second:    4622.12 [#/sec] (mean)

SSL config source

Be aware: https://twitter.com/jessemcnelis/status/508456580384178178

$ ab -n 10000 -c 100 -f TLS1 https://127.0.0.1:3008/

This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 127.0.0.1 (be patient)
Completed 1000 requests
Completed 2000 requests
Completed 3000 requests
Completed 4000 requests
Completed 5000 requests
Completed 6000 requests
Completed 7000 requests
Completed 8000 requests
Completed 9000 requests
Completed 10000 requests
Finished 10000 requests


Server Software:
Server Hostname:        127.0.0.1
Server Port:            3008
SSL/TLS Protocol:       TLSv1,AES256-SHA,2048,256

Document Path:          /
Document Length:        16898 bytes

Concurrency Level:      100
Time taken for tests:   112.267 seconds
Complete requests:      10000
Failed requests:        0
Write errors:           0
Total transferred:      172290000 bytes
HTML transferred:       168980000 bytes
Requests per second:    89.07 [#/sec] (mean)
Time per request:       1122.669 [ms] (mean)
Time per request:       11.227 [ms] (mean, across all concurrent requests)
Transfer rate:          1498.68 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:       56  791 652.1    736   11582
Processing:     1  330 199.4    302    1041
Waiting:        0  321 201.9    293    1040
Total:        109 1121 661.4   1079   11699

Percentage of the requests served within a certain time (ms)
  50%   1079
  66%   1156
  75%   1248
  80%   1306
  90%   1459
  95%   1561
  98%   1879
  99%   3507
 100%  11699 (longest request)

$ ab -n 10000 -c 100 http://127.0.0.1:3008/

This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 127.0.0.1 (be patient)
Completed 1000 requests
Completed 2000 requests
Completed 3000 requests
Completed 4000 requests
Completed 5000 requests
Completed 6000 requests
Completed 7000 requests
Completed 8000 requests
Completed 9000 requests
Completed 10000 requests
Finished 10000 requests


Server Software:
Server Hostname:        127.0.0.1
Server Port:            3008

Document Path:          /
Document Length:        16898 bytes

Concurrency Level:      100
Time taken for tests:   2.164 seconds
Complete requests:      10000
Failed requests:        0
Write errors:           0
Total transferred:      172290000 bytes
HTML transferred:       168980000 bytes
Requests per second:    4622.12 [#/sec] (mean)
Time per request:       21.635 [ms] (mean)
Time per request:       0.216 [ms] (mean, across all concurrent requests)
Transfer rate:          77768.01 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   5.3      0     217
Processing:     1   21  20.0     19     233
Waiting:        1   21  19.9     19     233
Total:          4   21  20.6     19     233

Percentage of the requests served within a certain time (ms)
  50%     19
  66%     20
  75%     21
  80%     22
  90%     23
  95%     24
  98%     24
  99%     28
 100%    233 (longest request)
@SchumacherFM
Copy link
Author

This version is with clientSessionCache https://github.com/SchumacherFM/wanderlust/blob/master/picnic%2Fmain.go#L118

slightly faster ... or clientSessionCache too small with 128 ?

$ ab -n 10000 -c 100 -f TLS1 https://127.0.0.1:3008/

This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 127.0.0.1 (be patient)
Completed 1000 requests
Completed 2000 requests
SSL read failed - closing connection
SSL read failed - closing connection
SSL read failed - closing connection
Completed 3000 requests
Completed 4000 requests
Completed 5000 requests
Completed 6000 requests
Completed 7000 requests
Completed 8000 requests
Completed 9000 requests
Completed 10000 requests
Finished 10000 requests


Server Software:
Server Hostname:        127.0.0.1
Server Port:            3008
SSL/TLS Protocol:       TLSv1,AES256-SHA,2048,256

Document Path:          /
Document Length:        16898 bytes

Concurrency Level:      100
Time taken for tests:   111.009 seconds
Complete requests:      10000
Failed requests:        3
   (Connect: 0, Receive: 0, Length: 3, Exceptions: 0)
Write errors:           0
Total transferred:      172307229 bytes
HTML transferred:       168996898 bytes
Requests per second:    90.08 [#/sec] (mean)
Time per request:       1110.087 [ms] (mean)
Time per request:       11.101 [ms] (mean, across all concurrent requests)
Transfer rate:          1515.82 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0  768 648.2    708    9467
Processing:     1  339 517.6    310   28045
Waiting:        0  322 196.4    299    1001
Total:        168 1107 795.3   1059   28045

Percentage of the requests served within a certain time (ms)
  50%   1059
  66%   1108
  75%   1175
  80%   1231
  90%   1402
  95%   1535
  98%   2373
  99%   4091
 100%  28045 (longest request)

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