Preface: I'm devloping a successor to
Gourmet. The redesinged database part is ready, importing (and converting in the process) Gourmet's database works so far. Since I want to support different database backends (sqlite, MySQL, PostgreSQL) I'm testing it with all three backends, sqlite on local, MySQL/PostgreSQL on a remote machine connecting via ssh tunnel (I didn't want to expose the database ports to the public).
I had some amazing results: Importing my 245 recipes from Gourmet took sqlite approx 15 seconds, the remote database (no matter if MySQL or PostgreSQL) between 515 an 950(!) seconds. To investigate the matter I installed a local MySQL/MariaDB and let the importer run again:
Finished. Imported 245 recipes of 245 (0 duplicates, 0 errors), added 7 new units. Took 20.12 seconds
So - ssh-tunnel creates a
huge latency (it's not a matter of CPU or something like that - the remote machine is virtually doing nothing apart from seti@home. I even disabled seti@home temporarily to test this). More than 25 to 50 times slower via ssh tunnel than on local. Can anyone explain to me why this is the case? I mean I expected some perfomance issue using a tunnel but not something like this...