Bug #111887 Slow first statement after connection to remote MySQL server
Submitted: 25 Jul 2023 20:53 Modified: 26 Jul 2023 13:05
Reporter: David Del Signore Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Workbench Severity:S5 (Performance)
Version:8.0.34 OS:Windows (Microsoft Windows 10 Pro)
Assigned to: CPU Architecture:x86
Tags: WBBugReporter

[25 Jul 2023 20:53] David Del Signore
Description:
Backend db mysql-community-server-5.7.43-1.el7.x86_64

When connecting to remote MySQL servers (from USA to Asia, via private 150 Mbps MPLS circuit) the first statement executed takes excessively long to return a result - on the order of 3 minutes. For example, execution of the statement "SELECT 1;" took 185 seconds.

This lag is not reflected in the duration/fetch column in the action output panel - the duration displayed is very short (0.2s for the above query).

After the first statement completes, subsequent statements perform normally, with no unexpected lag. For example, repeating the above select statement completes immediately.

This behavior is observed when connecting to a remote replica of the remote server (same site).

This behavior is not observed when connecting to a local replica of the remote server.

This behavior is not observed under Workbench 6.3.

This behavior is not observed using the CLI from a local machine.

How to repeat:
1. Connect to remote db server
2. Execute statement 'SELECT 1'
3. Wait
[26 Jul 2023 12:25] MySQL Verification Team
Hello David,

Thank you for the bug report.
Imho this is duplicate of Bug #96949, please see Bug #96949 and follow the suggested workaround. Thanks.

Regards,
Ashwini Patil
[26 Jul 2023 13:05] David Del Signore
Thanks Ashwini.

The suggestion on 96949 does not fix the issue.

We are running community edition of MySQL 5.7, which AFAICS is supported by Workbench 8:

MySQL Workbench 8.0 is the current release and is recommended for MySQL 8.0. It also works with MySQL 5.7.