1

We use the cf ssh command to open a tunnel so we can access the MariaDB from our jenkins job.

cf ssh -N -L 13000:10.0.20.18:3306 hostapp &

As soon as the tunnel is open, we have [liquibase][http://www.liquibase.org] connect to the DB to update the schema. This works fine so far, but some of the DDL scripts and dataloads do take a long time and unfortunate it seems that the cf ssh tunnel is only open for about 24 minutes and then the connection is dropped.

Is there any way to extend this time? In other environments then swisscom, we used to have DDL manipulations on large tables which did take up to 2 hours, but it was not an issue as we did not have to go through a tunnel, but had a direct connection to the DB and the DB had the timeout set to multiple hours.

While writing this... maybe its not even ssh that drops the connection, but the DB drops it? What is the connection timeout on the swisscom MariaDB?

domi
  • 2,167
  • 1
  • 28
  • 45
  • 2
    According to your connection string you're still using Swisscoms old MariaDB offering. Please migrate your database to the new 'MariaDBEnt' service. Further I'm trying to verify the timeout of ssh sessions in Swisscoms Appcloud. – Lafunamor Nov 02 '17 at 06:56
  • Here is a guide on how to migrate your DB to the new service offering: https://docs.developer.swisscom.com/service-offerings/migrate-mariadb-to-mariadbent.html – Lafunamor Nov 02 '17 at 07:19
  • 1
    thanks, changed to a new instance and use "cf ssh -L 13000:galera-service.service.consul:3306 hostapp &" now - issue is still the same – domi Nov 02 '17 at 07:52
  • 1
    I was unable to find a ssh timeout within half an hour, so it seems like your problem has a different source. Just to be sure you can open the ssh connection with the following command: `cf ssh hostapp -c 'while true; do sleep 60; done'` Additionally there shouldn't be any timeouts from MariaDB itself. – Lafunamor Nov 02 '17 at 08:32
  • yes, the command works fine - I now see if I can run this command for longer then 30min – domi Nov 02 '17 at 08:40
  • it now seems to work - at least the command is running since an hour now, don't know why it did not before... btw. does the memory size of the 'hostapp' have an impact on the performance too? my script stage a full new space and I just started a small app to have a tunnel before any of the real apps gets installed. – domi Nov 02 '17 at 11:19
  • 1
    Since the app is just used for tunneling, it should not really have an impact. Generally it's no recommended to do such things this way. You app should perform DB migrations during startup. – Lafunamor Nov 02 '17 at 12:26
  • 2
    I really disagree on this one, I think doing DB upgrades during app startup is a really bad practice. Just think about all the sync issues you get when you have multiple instances trying to do DB upgrade during a startup, and thats just one of the issues... – domi Nov 02 '17 at 12:47

0 Answers0