I'm currently testing some configurations with vagrant (virtual box) to connect 2 servers (VM currently) together through an SSH tunnel. The goal being to securely connect my web app to the database.
The issue is that when I query the database through an SSH tunnel, my queries are 5 to 80 times slower than if I don't use a tunnel. Here is the command I'm using :
ssh -N -L 3306:127.0.0.1:3306 sshuser@192.168.10.10
From what I read, the overhead should not be that much, so I've tried a few things to speed up the transferts. I find out that if I remove the -N
option, the queries are quite as fast as if I don't use a tunnel but I'm being logged in the terminal as 'sshuser' (and adding a &
at the end of the command do weird things...).
So knowing that, I have a few questions :
Are my data still encrypted when I remove the
-N
option ?If so, what can I do to keep the performance without being logged as 'sshuser' in the console ?
Are they any options I can use to make the encryption faster ?
Thanks in advance for your light.