I currently have a OpenVPN Server running on my main HAProxy Server.
The OpenVPN Server connects to 3 backend servers.
I have been noticing that serving pages by accessing the backend servers over openvpn is much much slower than accessing the backend servers directly.
There is negligible ping between the VMs.
Would it be possible to get it a bit faster with tuning since there is minimal latency, or am I expecting too much?
Thanks for reading,
Ping
20 packets transmitted, 20 received, 0% packet loss, time 19000ms
rtt min/avg/max/mdev = 0.834/0.948/1.743/0.187 ms
Server Config
local [redacted]
port 1194
proto udp
dev tap1
ca easy-rsa/keys/ca.crt
cert easy-rsa/keys/GeorginaHaig.crt
key easy-rsa/keys/GeorginaHaig.key # This file should be kept secret
dh easy-rsa/keys/dh2048.pem
server 192.168.6.0 255.255.255.0
ifconfig-pool-persist ipp.txt
client-config-dir ccd
client-to-client
keepalive 10 120
tls-auth easy-rsa/keys/ta.key 0 # This file is secret
persist-key
persist-tun
status openvpn-status.log
verb 3
Client Config
client
dev tap2
proto udp
remote [redacted]
resolv-retry infinite
nobind
persist-key
persist-tun
ca haproxy/ca.crt
cert haproxy/EmmaStone.crt
key haproxy/EmmaStone.key
ns-cert-type server
tls-auth haproxy/ta.key 1
verb 8
Haproxy - Without VPN
Concurrency Level: 100
Time taken for tests: 0.466 seconds
Complete requests: 2000
Failed requests: 0
Total transferred: 3020000 bytes
HTML transferred: 2312000 bytes
Requests per second: 4294.90 [#/sec] (mean)
Time per request: 23.283 [ms] (mean)
Time per request: 0.233 [ms] (mean, across all concurrent requests)
Transfer rate: 6333.29 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 2 2.2 1 11
Processing: 5 20 7.9 19 86
Waiting: 5 20 7.7 19 86
Total: 6 22 8.3 21 87
Percentage of the requests served within a certain time (ms)
50% 21
66% 24
75% 26
80% 27
90% 33
95% 38
98% 45
99% 51
100% 87 (longest request)
Haproxy - With VPN
Concurrency Level: 100
Time taken for tests: 3.738 seconds
Complete requests: 2000
Failed requests: 0
Total transferred: 3020000 bytes
HTML transferred: 2312000 bytes
Requests per second: 535.04 [#/sec] (mean)
Time per request: 186.902 [ms] (mean)
Time per request: 1.869 [ms] (mean, across all concurrent requests)
Transfer rate: 788.98 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 1 0.7 0 8
Processing: 34 153 241.8 68 2196
Waiting: 34 153 241.8 68 2196
Total: 37 153 241.9 69 2196
WARNING: The median and mean for the initial connection time are not within a normal deviation
These results are probably not that reliable.
Percentage of the requests served within a certain time (ms)
50% 69
66% 80
75% 104
80% 130
90% 327
95% 1003
98% 1070
99% 1085
100% 2196 (longest request)