I setup an OpenVPN tunnel between two hosts with 50Mbit/s connection. If I test the speed of the endpoints, it's give the 50Mbit speed exactly. But when I do the same over OpenVPN connection, it's limited to 20MBit/s.
Meanwhile the VPN servers (both are rackable servers with high performance) has no significant performance issue. Under 10% CPU usage always.
What would be that setting on OpenVPN what can cause that ?
How are you measuring throughput?
OpenVPN only adds 69 bytes of overhead, which is less than 5% on a 1431 byte packet.
One troubleshooting step may be to see if your clients/servers are trying to send 1500 byte packets that get fragmented, which will severely degrade performance.
Be sure you're using "proto udp" as tcp in tcp is known to be problematic.
Compare the throughput numbers for UDP versus TCP transport here.
I don't think you should expect the same speed in a VPN tunnel. Since the packets have to be encrypted and decrypted it does cause some overhead.
I'm not sure if that could explain a 30Mbps drop but that can explain why you don't have 50Mbps.