question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Option for local MySQL requests be async

See original GitHub issue

I’ve been experiencing server lag… I am running paper-298 (currently) and have been trying to track down why I’m seeing lag spikes. After many timings reports & a suspicion of Dynmap, I set the write interval on the JsonFileClientUpdateComponent writeinterval to 35

Sure enough, every 35 seconds my server chugs…

[13:13:33 INFO]: Server tick times (avg/min/max) from last 5s, 10s, 1m:
[13:13:31 INFO]: ◴ 1.7/0.3/93.9, 1.2/0.3/93.9, 0.9/0.2/94.5
[13:13:48 INFO]: ◴ 0.7/0.2/2.0, 0.7/0.2/2.3, 0.9/0.2/94.5
...
[13:14:05 INFO]: ◴ 0.7/0.3/2.1, 0.7/0.3/2.1, 0.8/0.2/93.9
[13:14:06 INFO]: ◴ 1.7/0.3/93.8, 1.2/0.3/93.8, 0.9/0.2/93.9

I suspect this issue is often not as easy to detect as most people are running MySQL on their machine. I have a tunnel setup to a web-host that runs the SQL database & dynmap standalone. Hence, my access times are longer & why I have a noticeable slowdown to my server. Also, disconnects from jdbc make server unusable due to constant re-connect requests.

The fix to this is to move dynmap’s database operations off the main thread & make them asynchronous.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
mikeprimm-trivacommented, May 27, 2020

Gotcha - I’ve made a couple of changes in the latest SNAPSHOT builds on https://dynmap.us/builds/dynmap (SNAPSHOT, not the RC builds). Let me know if you give it a try and how it goes.

1reaction
mikeprimm-trivacommented, May 26, 2020

Understood on the request - I’ll need to see how much of a pain it is: the storage system is abstracted, and most of the I/O is off the server thread, but not all of it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

WL#11381: Add asynchronous support into the mysql protocol
C APIs are synchronous, which means client sends a request and waits until server responds. This makes applications to not do anything until...
Read more >
Does MySql Connection methods support async programming?
MySQL Connector/NET (i.e., MySql.Data) exposes the async ADO.NET methods, e.g., MySqlConnection.OpenAsync , MySqlCommand.
Read more >
mysql-async is configured by setting set ...
mysql -async is configured by setting set mysql_connection_string "[string]" . The connection string can either be formatted like an url:
Read more >
How to interact with MySQL database using async/await ...
The combination async/await syntax, introduced in node.js version 8, and promises makes writing MySQL queries in node.js easier with a ...
Read more >
Asynchronous Operations: Extensions
The async MySQL extension provides a Hack API to query MySQL and similar databases. All relevant methods return an Awaitable , which gives...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found