0

In MySQL/Aurora I see from time to time a spike in connections number (from about 100 to 4000): enter image description here

MySQL doc says:

Connections

The number of connection attempts (successful or not) to the MySQL server.

So I was thinking those coming from failed connection, however I don't see failures:

MySQL [(none)]> SHOW GLOBAL STATUS like 'Conn%';
+-----------------------------------+----------+
| Variable_name                     | Value    |
+-----------------------------------+----------+
| Connection_errors_accept          | 0        |
| Connection_errors_internal        | 0        |
| Connection_errors_max_connections | 0        |
| Connection_errors_peer_address    | 0        |
| Connection_errors_select          | 0        |
| Connection_errors_tcpwrap         | 0        |
| Connections                       | 34388970 |
+-----------------------------------+----------+
7 rows in set (0.00 sec)

MySQL [(none)]> show global variables like '%conn%';
+-----------------------------------------------+-------------------+
| Variable_name                                 | Value             |
+-----------------------------------------------+-------------------+
| aurora_max_connections_limit                  | 16000             |
| connect_timeout                               | 10                |
| disconnect_on_expired_password                | ON                |
| init_connect                                  |                   |
| max_connect_errors                            | 100               |
| max_connections                               | 4000              |
| max_user_connections                          | 0                 |
| performance_schema_session_connect_attrs_size | 512               |
+-----------------------------------------------+-------------------+

I would very much like to understand what those are and when they are coming from.

2
  • 1
    A good way to understand where the connections are coming from is to look at the flow log for your Aurora instance.
    – mustaccio
    Oct 13 '20 at 20:32
  • Yeah I was looking on those, got me to the source server but still looking for the source script :D
    – Nir
    Oct 14 '20 at 7:00
0
  • Sounds like a hacker.
  • Based on your graphs, I suggest that max_connections = 4000 is unreasonably high. It looks like 20 might be reasonable.
  • You might want to set max_user_connections to some reasonable value (instead of 0 for "unlimited").
2
  • Unfortunately it won't tell me the source of those connections.
    – Nir
    Oct 14 '20 at 7:02
  • Look for TCP tools.
    – Rick James
    Oct 14 '20 at 16:29

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.