Bug #92977 MySQL Workbench 8 high CPU on SSH connections
Submitted: 27 Oct 2018 10:18 Modified: 29 Apr 2021 17:56
Reporter: Martin Frost Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Workbench Severity:S5 (Performance)
Version:8.0.15 OS:MacOS (10.13.6)
Assigned to: MySQL Verification Team CPU Architecture:x86

[27 Oct 2018 10:18] Martin Frost
Description:
Opening a connection via SSH in MySQL Workbench version 8 results in high CPU while the connection is open. Version 6 would show minimal CPU while an SSH connection was open.

How to repeat:
Open a connection to MySQL via SSH and observer the CPU usage.
[28 Oct 2018 16:27] MySQL Verification Team
Activity Monitor

Attachment: 92977.png (image/png, text), 453.14 KiB.

[28 Oct 2018 16:34] MySQL Verification Team
Thank you for the bug report. I couldn't repeat please attach here a screenshot of your Activity Monitor (private if you wish).
[2 Nov 2018 16:51] MySQL Verification Team
Thank you for the feedback. Is this behavior repeatable when are 2 WorkBench instances running?. Thanks.
[3 Dec 2018 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[18 Jan 2019 19:53] Dan Pierce
I see no comments on this but I am seeing it as well. 

I  am on a Mac running Mojave.   Workbench is Version 8.0.0.13    WiIh one connection it goes to about 100% (just above actually).  When i start a 2nd connection it jumps to 200+%.

When i close the connection the CPU remains at 200%.  Closing both connections, CPU remains at 200%.   Using the Mac close (it mostly minimizes) it remains at 200%

I ultimately have to right click on the running icon and Quit.  

If scrennshots are required I can provide.
[4 Feb 2019 13:58] Martin Frost
The only way I can get two instances running is by running 8.0.15 and 6.3 side-by-side. Both connected via the same SSH connection.

If I do that, v8 uses around 90% CPU, v6.3 uses less than 1%.

> Thank you for the feedback. Is this behavior repeatable when are 2 WorkBench instances running?. Thanks.
[4 Feb 2019 15:01] Dan Pierce
What i have noticed is it doesn't always hammer the CPU.   However, it does seem to occur when I open up a second database connection (also, different SSH connection).   Once the CPU takes off, then i have to quit Workbench in order to get the CPU to come back down.     I can then fire up workbench and use it against one database for a while.

Inconsistent, but CPU spikes more often than not.
[6 Feb 2019 10:50] Martin Frost
I ran a sample on MySQL Workbench while this is happening. It has an SSH connection open, but sitting idle in the query window. There are no network packets coming in or out of MySQL Workbench. 

It seem to be spending a lot of the sample time in SSHTunnelHandler:transferDataFromClient() or SSHTunnelHandler:transferDataToClient(), despite there being no network packets in or out? I've attached a screenshot of the sample and an export of it in text format.

This only happens with connections over SSH, direct connections do not cause it.
[6 Feb 2019 10:51] Martin Frost
Sample of MySQL Workbench while using >80% CPU on an idle SSH connection

Attachment: Sample of MySQLWorkbench.txt (text/plain), 104.36 KiB.

[6 Feb 2019 10:53] Martin Frost
Screenshot of Activity Monitor sample showing SSHTunnelHandler time

Attachment: Screen Shot 2019-02-06 at 10.38.23.png (image/png, text), 190.93 KiB.

[13 Feb 2019 0:45] David Koch
We have the same issue on Redhat Linux 3.10.0-957.5.1.el7.x86_64
[18 Feb 2019 14:12] Samih Harfouche
I am facing the same problem. I am connecting over SSH and the moment I get connected the processing starts building up without even executing any query.

- Workbench 8.0.15 build 14271522 CE 
- macOS Mojave vision 10.14
[16 Mar 2019 10:08] Bartłomiej Gajda
Latest Mac OS Mojave, Workbench 8.0.15, connection via tunnel ssh, about 99% all time

Attachment: Zrzut ekranu 2019-03-16 o 11.03.42.png (image/png, text), 39.01 KiB.

[29 Mar 2019 11:37] Jan Venekamp
I have observed a 100% cpu usage on SSH connections as well. However after disabling SSL for the connection (not SSH) and restarting Workbench the cpu usage was normal.
[14 Jun 2019 19:15] Miguel Reyes
Getting the same in version 8.0.16 with Mojave OSX and with an SSH tunnel. I noticed this because the fan of my MacBook Pro (15-inch, 2018) started running constantly for several minutes.
[5 Jul 2019 7:34] Yoch Melka
Same issue here, with 8.0.16 on Ubuntu 18.04
[5 Mar 2020 9:17] Justas Pranskaitis
Got very similar issue.

MacOS Catalina 10.15.3
Workbench 8.0.19

Modified mysql tools to:
/usr/local/Cellar/mysql@5.7/5.7.29/bin/mysqldump
/usr/local/Cellar/mysql@5.7/5.7.29/bin/mysql

While connected to Mysql 5.7 over SSH tunel CPU usage is just normal. After executing long query which dies due to timeout Workbench CPU usage spikes straight to 100%.
[9 Jul 2020 16:11] MySQL Verification Team
Hi Martin et all,

I'm trying to reproduce this using 8.0.20 on
 - windows 10
 - macos catalina 10.15.5
 - fedora 31
 - oracle linux 7

And I'm unable to reproduce the problem.

Questions
 - do you see this with 8.0.20 too?
 - do you see this when connecting to 8.0.20 server?
 - can you share connection config to the server that can repeatably overload cpu on the WB host?
 - what happens if you open 2+ instances of WB on the same host?

Thanks
Bogdan
[9 Jul 2020 16:13] MySQL Verification Team
One other, rather important, question.

Do you have CPU load happening when you connect both to servers in LAN and when the servers are in WAN - far away? 

Can you run long ping to your server to check the network quality?

thanks
Bogdan
[9 Jul 2020 17:46] Martin Frost
The key to fixing this for me was this comment:

> [29 Mar 2019 11:37] Jan Venekamp

> I have observed a 100% cpu usage on SSH connections as well. However after disabling SSL for the connection (not SSH) and restarting Workbench the cpu usage was normal.

---

It seems like in 8.x, the default on the SSL tab had changed to "If available", and this causes the CPU to hit 100%. When I turned SSL to "No" on my SSH connections, the problem went away. I think I confirmed that back in 6.x, the default on the SSL tab was "No".

I'm stuck on MacOS 10.13.6 and WB 8.0.16 I'm afraid, so I can't test more recent versions of either.
[10 Aug 2020 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[29 Mar 2021 13:16] Lanka Senanayaka
> [9 Jul 2020 17:46] Martin Frost
> The key to fixing this for me was this comment:

> > [29 Mar 2019 11:37] Jan Venekamp

> > I have observed a 100% cpu usage on SSH connections as well. However after 
> disabling SSL for the connection (not SSH) and restarting Workbench the cpu > usage was normal.

> ---

> It seems like in 8.x, the default on the SSL tab had changed to "If available", and this causes the CPU to hit 100%. When I turned SSL to "No" on my SSH connections, the problem went away. I think I confirmed that back in 6.x, the default on the SSL tab was "No".

This worked in Ubuntu 20 also
[29 Mar 2021 13:30] MySQL Verification Team
I cannot reproduce this on 
 - latest macos
 - latest centos
 - fully updated win10
with latest mysqld and workbench
[29 Mar 2021 17:06] Lanka Senanayaka
HI There,
This is how this bug happen,
1. Connect MySQL Workbench 8 to remote db (AWS, or ssh will be fine)
2. Change ip address of your local machine (If using wifi router switch off and on router), When I use vpn this happened also.
3. This can be happen most in non static ip adresses.
4. With some time may be one hour cpu usage shows as 100%

My problem in Ubuntu 20 is not yet solved.
[29 Mar 2021 17:56] MySQL Verification Team
Hi Lanka,

You are saying
 - you connect to remote server trough SSL enabled connection
 - you restart your internet connection

That should break the connection to the server, and when I test this, I will lose connection. You are stating that instead of losing connection, you get 100% cpu usage on the WB? Please confirm you are using latest WB.

thanks
Bogdan
[29 Mar 2021 18:46] Lanka Senanayaka
I feel like this,
Internet service drop and reconnecting sometimes and while working we are connecting to vpn to access live servers.
[29 Mar 2021 18:49] Lanka Senanayaka
MySQL Workbench 8.0.22 
I'm updating to MySQL Workbench 8.0.23 now and let you know. 
Thanks.
[30 Apr 2021 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".