优化OpenVPN连接?

对于我来说这几天现在让我很头痛。

我有两台服务器在不同的位置。 我们使用OpenVPN连接两台服务器。

Server1 has a Uplink of ~100mbps (OPENVPN Server) Server2 has a Uplink of ~50mbps (OPENVPN Client) 

但是,我configuration了2内的openVPN后,我几乎不能超过2mbps的速度。

我使用HTTP来testing彼此的上行链路。

  HTTP, NO VPN HTTP, WITH VPN SV1<->SV2 48mbps(6MB/s) 2-3mbps (~200-300KB/s) 

这是我在服务器端的configuration(SV1):

 port 1194 proto udp dev tun #tun-mtu 9000 fragment 0 mssfix 0 ca ca.crt cert mysite.crt key mysite.key dh dh1024.pem cipher none auth none server 10.8.0.0 255.255.255.0 keepalive 10 120 comp-lzo max-clients 1 persist-key persist-tun #status openvpn-status.log #verb 3 

在客户端(SV2)

 client proto udp dev tun #tun-mtu 9000 remote 123.34.56.7 1194 resolv-retry infinite nobind #persist-key #persist-tun cipher none auth none ca ca.crt cert mysite.crt key mysite.key comp-lzo #verb 3 

iperf上的大部分testing都以1mbps显示相同的速度。

 [ ID] Interval Transfer Bandwidth Jitter Lost/Total Datagrams [1884] 0.0-10.0 sec 1.20 MBytes 1.00 Mbits/sec 6.220 ms 38/ 893 (4.3%) [1884] local 10.8.0.1 port 11100 connected with 10.8.0.6 port 54784 [ ID] Interval Transfer Bandwidth Jitter Lost/Total Datagrams [1884] 0.0-10.0 sec 1.21 MBytes 1.01 Mbits/sec 6.307 ms 29/ 893 (3.2%) [1884] local 10.8.0.1 port 11100 connected with 10.8.0.6 port 50475 [ ID] Interval Transfer Bandwidth Jitter Lost/Total Datagrams [1884] 0.0-10.0 sec 1.19 MBytes 996 Kbits/sec 6.564 ms 45/ 893 (5%) [1884] local 10.8.0.1 port 11100 connected with 10.8.0.6 port 44565 [ ID] Interval Transfer Bandwidth Jitter Lost/Total Datagrams [1884] 0.0-10.0 sec 1.20 MBytes 1.01 Mbits/sec 6.152 ms 34/ 893 (3.8%) 

我该怎么做才能改善呢?

一个原因可能是UDPstream量在某处形成。 尝试直接在服务器之间使用-u -p 1194运行iperf,而不使用OpenVPN。 如果这仍然很慢尝试不同的端口和不同的UDP和TCP与Iperf,看看是否有所作为。

如果任何一台服务器的CPU真的老了,也可以尝试删除压缩选项comp-lzo。