Bug #92977 MySQL Workbench 8 high CPU on SSH connections
Submitted: 27 Oct 2018 10:18 Modified: 9 Jul 18:27
Reporter: Martin Frost Email Updates:
Status: Need Feedback Impact on me:
None 
Category:MySQL Workbench Severity:S5 (Performance)
Version:8.0.15 OS:Mac OS X (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 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 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 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 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.