Skip to content

Instantly share code, notes, and snippets.

@wadewilliams
Last active December 20, 2018 21:32
Show Gist options
  • Save wadewilliams/c76c3bd85ef738dffa859cf92d0e572e to your computer and use it in GitHub Desktop.
Save wadewilliams/c76c3bd85ef738dffa859cf92d0e572e to your computer and use it in GitHub Desktop.
Ubuntu Xserve Install

Installation

Security Improvements

Obvious things to lock it down

sshd config to kill dead sessions

https://haydenjames.io/kill-inactive-ssh-sessions/

unblocking yourself when denyhosts boots you.

https://www.cyberciti.biz/faq/linux-howto-check-ip-blocked-against-iptables/

Getting free certs

https://www.humankode.com/ssl/how-to-set-up-free-ssl-certificates-from-lets-encrypt-using-docker-and-nginx https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-16-04

Benchmarking

https://www.digitalocean.com/community/tutorials/an-introduction-to-load-testing

Apache Bench ab test

root@8ac1e23c14cb:/# ab -n 1000 -c 100 https://tetontechlab.com/
This is ApacheBench, Version 2.3 <$Revision: 1706008 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking tetontechlab.com (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Completed 1000 requests
Finished 1000 requests


Server Software:        nginx/1.10.0
Server Hostname:        tetontechlab.com
Server Port:            443
SSL/TLS Protocol:       TLSv1.2,ECDHE-RSA-AES256-GCM-SHA384,2048,256

Document Path:          /
Document Length:        12666 bytes

Concurrency Level:      100
Time taken for tests:   12.070 seconds
Complete requests:      1000
Failed requests:        0
Total transferred:      13012000 bytes
HTML transferred:       12666000 bytes
Requests per second:    82.85 [#/sec] (mean)
Time per request:       1206.997 [ms] (mean)
Time per request:       12.070 [ms] (mean, across all concurrent requests)
Transfer rate:          1052.78 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:       56  175 175.2     98    2464
Processing:   114  998 580.3    923    3111
Waiting:      110  833 248.7    903    1282
Total:        325 1173 534.1   1058    3188

Percentage of the requests served within a certain time (ms)
  50%   1058
  66%   1119
  75%   1166
  80%   1196
  90%   2104
  95%   2578
  98%   2998
  99%   3061
 100%   3188 (longest request)

After installing 2nd powersupply

root@8ac1e23c14cb:/# ab -n 1000 -c 100 https://tetontechlab.com/
This is ApacheBench, Version 2.3 <$Revision: 1706008 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking tetontechlab.com (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Completed 1000 requests
Finished 1000 requests


Server Software:        nginx/1.10.0
Server Hostname:        tetontechlab.com
Server Port:            443
SSL/TLS Protocol:       TLSv1.2,ECDHE-RSA-AES256-GCM-SHA384,2048,256

Document Path:          /
Document Length:        12666 bytes

Concurrency Level:      100
Time taken for tests:   10.367 seconds
Complete requests:      1000
Failed requests:        0
Total transferred:      13012000 bytes
HTML transferred:       12666000 bytes
Requests per second:    96.46 [#/sec] (mean)
Time per request:       1036.668 [ms] (mean)
Time per request:       10.367 [ms] (mean, across all concurrent requests)
Transfer rate:          1225.76 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:       55  159 173.5     97     693
Processing:    96  837 214.5    842    1481
Waiting:       90  827 213.2    827    1478
Total:        618  996 167.6    975    1631

Percentage of the requests served within a certain time (ms)
  50%    975
  66%   1041
  75%   1087
  80%   1123
  90%   1225
  95%   1341
  98%   1419
  99%   1463
 100%   1631 (longest request)

~3pm mountain 12/11/18

/~# ab -n 1000 -c 100 https://tetontechlab.com/
This is ApacheBench, Version 2.3 <$Revision: 1706008 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking tetontechlab.com (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Completed 1000 requests
Finished 1000 requests


Server Software:        nginx/1.10.0
Server Hostname:        tetontechlab.com
Server Port:            443
SSL/TLS Protocol:       TLSv1.2,ECDHE-RSA-AES256-GCM-SHA384,2048,256

Document Path:          /
Document Length:        12666 bytes

Concurrency Level:      100
Time taken for tests:   10.480 seconds
Complete requests:      1000
Failed requests:        0
Total transferred:      13012000 bytes
HTML transferred:       12666000 bytes
Requests per second:    95.42 [#/sec] (mean)
Time per request:       1048.041 [ms] (mean)
Time per request:       10.480 [ms] (mean, across all concurrent requests)
Transfer rate:          1212.46 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:       21  137 117.5     97     543
Processing:   131  869 237.2    858    1459
Waiting:      128  859 237.7    841    1455
Total:        535 1006 193.3    989    1598

Percentage of the requests served within a certain time (ms)
  50%    989
  66%   1066
  75%   1129
  80%   1163
  90%   1266
  95%   1352
  98%   1436
  99%   1506
 100%   1598 (longest request)

Before

root@8ac1e23c14cb:/# curl -o /dev/null -w "Connect: %{time_connect} TTFB: %{time_starttransfer} Total time: %{time_total} \n" https://tetontechlab.com
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 12666    0 12666    0     0   8431      0 --:--:--  0:00:01 --:--:--  8432
Connect: 0.153 TTFB: 1.444 Total time: 1.502
_After_ 
curl -o /dev/null -w "Connect: %{time_connect} TTFB: %{time_starttransfer} Total time: %{time_total} \n" https://tetontechlab.com
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 12666    0 12666    0     0  30779      0 --:--:-- --:--:-- --:--:-- 30742
Connect: 0.148 TTFB: 0.376 Total time: 0.412

nmap

root@8ac1e23c14cb:/# nmap -p 443 tetontechlab.com

Starting Nmap 7.01 ( https://nmap.org ) at 2018-12-11 18:54 UTC
Nmap scan report for tetontechlab.com (207.183.160.48)
Host is up (0.0041s latency).
rDNS record for 207.183.160.48: dsl-207-183-160-48.freedom.wy.silverstar.com
PORT    STATE SERVICE
443/tcp open  https

Nmap done: 1 IP address (1 host up) scanned in 0.79 seconds

Testing for Speed

speeding it up

SSL tweakikng

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