Ubuntu – Ssh and other services over openvpn are slow

openvpnremote-accesssshUbuntu

I use openvpn to access my workplace network. When I ssh into a server(Ubuntu) over openvpn, as I type into the shell prompt the characters and letters appear slowly. So I should wait a little to see on the screen what I type. If I ssh directly (not via openvpn) then there is no delay at all. All other services also respond slowly: for e.g. accessing intranet web-pages, ftp or router configuration GUI, almost everything shows delay. I use 2 Mbps down and 800 Kbps up ADSL connection at home. And at work place I have 4 Mbps up and down ethernet based internet connection.

Best Answer

Any encryption mechanism will add an overhead to your connection, have in mind that overheads for some encryption are enormous.

OpenVPN by average will add a 40% to 50% overhead to your connection, on top of that ssh will also add a 40% overhead average.

All this can very easily explain why your connection over openvpn+ssh is so slow, you can do some things to make the connection lighter but it'll sacrifice a bit of security.

  • Use crypto signatures of 1024 bytes top (don't go 2048 or 4096 unless you really need to)
  • Use SSH1 or SSH2 with RSA instead of DSA (a bit less overhead)
  • Use SSH compression by default

All this will help make the tunnel lighter and faster, also if you have direct SSH access try using SSH tunnels to your application instead of OpenVPN, will remove one encryption layer and will also help speed wise.

I've replied to your question because I find it interesting but have in mind that if you don't accept your answers (the 17% accept rate indicates that), the community will be a lot less willing to help you out, this site is all about community and that accept rate is showing you as a not community player, which will hinder your results in the future.

Just take it as my 2ยข, no criticisim!