0

I'm having an issue with a very slow query in an C# WPF application. The application connects to a MySQL-server. As long as the application is used on my LAN, everything is going fast. When i use the application anywhere else, connecting to the DB over WAN, a simple query takes more than 10 seconds, not workable. The strange thing is that other services, like RDP, VNC, webhosting, streaming,... are working very fast over WAN, bandwidth can't be the problem i think.

This is the speedtest for the location where the server is: speedtest

What can i check/change to make this work better/workable over WAN?

Thanks in advance.

6
  • 2
    Individual queries might run fine over a WAN connection, but typically an application that uses a database connection makes many queries and those are sensitive to latency, which many WAN connections have plenty of. Keep the application and it's database close together. (and if you need remote access to the data, use a protocol like RDP that is WAN optimized to remotely access the application, rather than only accessing the database remotely.)
    – HBruijn
    Apr 3, 2019 at 7:23
  • The reason that I'm using a remote SQL, is that the user of the application needs to print invoices. The printer is locally installed at his location.
    – Dave
    Apr 3, 2019 at 8:06
  • The application does not need to run on the workstation a printer is attached to to make use of that printer. Remote desktop and similar allow remote applications to use local resources such as printers
    – HBruijn
    Apr 3, 2019 at 8:17
  • Thanks for the information. I will try to set up an RDP server for this.
    – Dave
    Apr 3, 2019 at 8:27
  • Please note that my suggestion is only one, you do have other options (like making your database queries and application design less sensitive to latency for instance)
    – HBruijn
    Apr 3, 2019 at 8:30

2 Answers 2

1

Try disabling DNS reverse resolving from the MySQL server by adding or un-commenting the skip-name-resolve option on the MySQL configuration file like so:

# Skip reverse DNS lookup 
skip-name-resolve
0

Try forcing compression protocol from the client side.

https://dev.mysql.com/doc/refman/8.0/en/mysql-command-options.html#option_mysql_compress

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.