I have a system where some queries are executed on the webapp server and others on the worker machines, that consume jobs from a queue.
Some clients make atipical requests for the database that exceed the 60 seconds for the HTTP transaction, receiving a Timeout error on the frontend.
On the other hand, the database keeps running those long queries. The users usually end up hitting the refresh button which leads to a overload on the database.
Is there a way to close those queries that were executed by the web server once the request has timed out? I understand I could place some limits on the MySQL server, but I do want the worker to be able to make long requests.