Unreasonable ammount of queries and connections to Azure Database for MySQL (flexible server)

Elias Bonnici 1 Reputation point
2021-08-14T09:14:56.69+00:00

For some strange reason my Azure MySQL server seems to be receiving a huge ammount of queries and I don't know why.

The only thing I've done is connecting my NodeJS express app to the MySQL server without sending any queries to it. Doing that I see (in azure portal) that the MySQL server has around 30 established connections and that number conitinues to grow for every minute (the same holds for queries).

The number of established connections and queries also seems to be growing even if I shut down the NodeJS express app. For instance, when I start the Azure MySQL server and let it run for a couple of minutes (with the NodeJS app being shut down) I have about 500 queries.

Does anybody know what could possibly be the reason for this problem? I have tried to create logs but can't see anything weird there!

Azure Database for MySQL
Azure Database for MySQL
An Azure managed MySQL database service for app development and deployment.
993 questions
{count} votes

1 answer

Sort by: Most helpful
  1. KalyanChanumolu-MSFT 8,351 Reputation points
    2021-08-20T10:49:39.363+00:00

    @Elias Bonnici Our apologies for the inconvenience caused to you.

    Please Configure audit logging to get more details on each connection, its origin, query text etc.
    This should help you understand which other clients are connecting to your database.

    You can then query Log Analytics using the below query to fetch the required information

    AzureDiagnostics  
    | where Category == ‘MySqlAuditLogs’  
    | order by TimeGenerated desc  
    | project TimeGenerated, event_class_s, event_subclass_s, user_s, external_user_s, connection_id_d, thread_id_d, event_time_t, sql_text_s, db_s, table_s, error_code_d  
    

    Read more about this topic here

    Please let us know if you have any further queries.

    ----------

    If an answer is helpful, please "Accept answer" or "Up-Vote" which might help other community members reading this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.