Keep Alive

[expired user #5142]'s profile image [expired user #5142] posted 14 years ago in Feature discussion Permalink
Hello

Is it possible to send null packets (keepalive packets) to keep a session active? It would be nice if the seconds between the packets could be configured.

Tnx
ansgar's profile image ansgar posted 14 years ago Permalink
This was done in some old release but in fact it's not required at all as HeidiSQL automatically reconnects on demand.

You can, however, increase the servers variable "wait_timeout" via HeidiSQL > Host > Variables, to avoid being disconnected for a longer time.
[expired user #5142]'s profile image [expired user #5142] posted 14 years ago Permalink
Our firewall is the one disconnecting the idle sessions, not the MySQL server, as our mysql-server's timeouts are set to 8 hours.

I'm working with HeidiSQL every day. I like how the program evolved throughout versions 3 to 5, but i've always missed this feature.

I understand you're not going to implement the feature again, certainly when you dropped it earlier, but are there some workarounds?
ansgar's profile image ansgar posted 14 years ago Permalink
With a working reconnection logic, why would you ever want to keep your connection alive, for what purpose?

Also, you should keep in mind that your firewall and/or the MySQL server disconnects you for a specific reason, which is: nothing to do for more than x seconds. Sending keep-alives seems to me like disabling a good feature.
[expired user #5142]'s profile image [expired user #5142] posted 14 years ago Permalink
Yes, I know exactly what you mean, but when my session is closed, it takes at least 20 seconds to reconnect again. I don't have this timeout when keepalives are present.
ansgar's profile image ansgar posted 14 years ago Permalink
20 seconds? You should find out why that takes so long.
muzza4's profile image muzza4 posted 14 years ago Permalink
Hi HostYou and Anse

I have the same problem as HostYou. After about 20 minutes with no use Heidi is unresponsive (not always but usually) for about 30 seconds. It's pretty frustrating.

I have raised this issue previously, and pointed out that the problem was present, was fixed in heidisql.r2688, and reappeared shortly after. I've looked back through the history and I suspect it was r2629 that fixed it.

I often use load version r2688 to avoid this very problem - I can assure you it doesn't occur with it.

Regards
Muzza
ansgar's profile image ansgar posted 14 years ago Permalink
The slowness fixed in both similar changes (r2629 and r2688) is still fixed - and was caused by loading table names from the current database into an internal list. Should not be a problem in the newer builds as this was not changed afterwards.

However, this thread discusses some unusual wait interval when connecting to a MySQL server through some firewall.
muzza4's profile image muzza4 posted 14 years ago Permalink
Hi Anse

I have just tested version 2688 vs 3528 after connecting them to the same database and then leaving them for an hour. V2688 was immediately responsive, while V3528 took 25 seconds to start again.

Interesting the V2688 exe is 932Kb and V3528 is 4748Kb. Possibly this is a clue?

I presume this issue doesn't affect everyone, but it's annoying for those it does affect. If you wanted to debug in this area I'd be happy to assist.

Regards
Muzza
ansgar's profile image ansgar posted 14 years ago Permalink
Filesize has mainly grown due to not using UPX anymore. Should of course not be any problem, apart from traffic on my website.

I highly guess r2688 also takes 25 seconds for the first connect, does it? If so, it will of course be a problem of the connection itself, Firewall stuff, server reachability or something else - no debugging in Heidi required in that case.
muzza4's profile image muzza4 posted 14 years ago Permalink
Hi Anse

One version of HeidiSQL doesn't give me a problem, and the latest one does. On the face of it, it looks like a software issue not a server issue, since it's the same server and setup.

Anyway, decision to investigate is yours (my offer stands).

Thanks as always, for providing this software.

Regards
Muzza
ansgar's profile image ansgar posted 14 years ago Permalink
You didn't say if the first connect also takes 25 seconds, does it?
muzza4's profile image muzza4 posted 14 years ago Permalink
yep
ansgar's profile image ansgar posted 14 years ago Permalink
Ok... (btw I'm investigating all the time). Only I'm obviously blind. Is there some query you can see after having connected in the log panel which takes so long? Or is it the connection handshake itself?
muzza4's profile image muzza4 posted 14 years ago Permalink
Hi Anse

1. Leave HeidiSQL for 30 minutes or so
2. Connected: shows 00:44:00 or similar
3. Bottom right states "Idle"
4. Click a table
5. Bottom right states "Fetching Rows"
6. After 30 seconds or so the rows appear
7. Connected: shows 00:00:03

So I guess it's the connection handshake.

Thanks
Muzza
ansgar's profile image ansgar posted 14 years ago Permalink
Yes, sounds right. Only I'm not able to reproduce such slowness neither here in conjunction with 5 different server versions nor in my company, nor using SSH tunnel or SSL options. Makes no sense to look after some bug when it does not appear here. That's the reason why I keep thinking it has something to do with your connection to the server.
muzza4's profile image muzza4 posted 14 years ago Permalink
Hi Anse

I expect it is a connection issue too, it's just that one version avoids or solves my problem and one doesn't.

> Makes no sense to look after some bug when it does not appear here <

I'm in a similar business to you, and I appreciate the non-reproducibility issue. Hence my suggestion to assist debug.

No problem though.

Thanks
Muzza
ansgar's profile image ansgar posted 14 years ago Permalink
Did you use exactly the same libmysql.dll in both r2688 and the latest build?
muzza4's profile image muzza4 posted 14 years ago Permalink
Yes, I simply have an extra file in the HeidiSQL folder called heidisql.r2688 the fast one.exe
ansgar's profile image ansgar posted 14 years ago Permalink
Hm honestly I have no clue what's going on here. Is that libmysql.dll from the latest release installer (5.1)?
muzza4's profile image muzza4 posted 14 years ago Permalink
Hi Anse

My libmysql.dll wasn't the latest one (I hadn't installed for ages, just run the updates). My version was April 2009.

I have now installed and have a February 2010 version of libmysql.dll, and tested over the last few hours. The situation does not appear to have changed.

Regards
Muzza
hantim's profile image hantim posted 13 years ago Permalink
I'm not a fan of reviving dorment topics, but I have been a new user of HeidiSQL and I like it but this reconnection lag is the one and only annoying thing at the moment.
Looks to me that a keep alive feature could be helpful to some if not all.

Kind regards,

HanTim
ansgar's profile image ansgar posted 13 years ago Permalink
Don't you think the server should not receive anything as long as the user doesn't click anywhere? If you get a reconnect too often you could increase your "wait_timeout" variable:
SET @@wait_timeout := 28800

This is 8 hours, the default value on newer servers. Older servers had 20 minutes by default if I recall right.
ansgar's profile image ansgar posted 11 years ago Permalink
The latest HeidiSQL build now has an internal non-configurable keep-alive feature. You should update especially if your SSH tunnel gets disconnected often.
[expired user #6791]'s profile image [expired user #6791] posted 11 years ago Permalink
Hej Ansgar,
thank you so much for this feature. This was on the top of my (few) wishes. It makes it much more convenient to work.
Maybe you can make it a little configurable in one of the next version.
Tack!

Please login to leave a reply, or register at first.